datastore: move cleanup_unreferenced_files to BackupDir impl and fix NS awareness

sync failed on cleanup due to always trying to do so in the root NS

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht
2022-05-11 18:39:05 +02:00
parent 92b9cc1554
commit 5566099849
3 changed files with 39 additions and 57 deletions

View File

@ -506,10 +506,7 @@ async fn pull_snapshot(
try_client_log_download(worker, reader, &client_log_name).await?;
}
// cleanup - remove stale files
snapshot
.datastore()
.cleanup_backup_dir(snapshot, &manifest)?;
snapshot.cleanup_unreferenced_files(&manifest)?;
Ok(())
}