Don't return if deets were produced

This commit is contained in:
Abhishek Pandey 2023-07-20 22:10:48 -07:00
parent 735ea9fa09
commit b8a75434c9
2 changed files with 8 additions and 1 deletions

View File

@ -344,7 +344,7 @@ func (op *BackupOperation) do(
backupID,
op.incremental && canUseMetadata && canUsePreviousBackup,
op.Errors)
if err != nil {
if err != nil && (deets == nil || deets.Empty()) {
return nil, clues.Wrap(err, "persisting collection backups")
}

View File

@ -401,6 +401,13 @@ func (b *Builder) Details() *Details {
return details
}
func (b *Builder) Empty() bool {
b.mu.Lock()
defer b.mu.Unlock()
return len(b.d.Entries) == 0
}
// --------------------------------------------------------------------------------
// Details
// --------------------------------------------------------------------------------