BackupEnvironment: do not set finished flag prematurely

we check if all dynamic_writers are closed and if the backup contains
any valid files, we can only mark the backup finished after those
checks, else the backup task gets marked as OK, even though it
is not finished and no cleanups run

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Dominik Csapak 2020-06-10 14:57:39 +02:00 committed by Wolfgang Bumiller
parent cf1bd08131
commit 476b4acadc
1 changed files with 2 additions and 2 deletions

View File

@ -430,8 +430,6 @@ impl BackupEnvironment {
state.ensure_unfinished()?;
state.finished = true;
if state.dynamic_writers.len() != 0 {
bail!("found open index writer - unable to finish backup");
}
@ -440,6 +438,8 @@ impl BackupEnvironment {
bail!("backup does not contain valid files (file count == 0)");
}
state.finished = true;
Ok(())
}