Skip to content

PostgreSQL backup tool with Point-In-Time-Recovery and restore verification

FIX (storages): Ignore files removal errors for unavailable storage when deleting the database

Rostislav Dugin793b57514669
diff --git a/backend/internal/features/backups/backups/service.go b/backend/internal/features/backups/backups/service.go
index b89bbdec..c5fff6a4 100644
--- a/backend/internal/features/backups/backups/service.go
+++ b/backend/internal/features/backups/backups/service.go
@@ -516,7 +516,10 @@ func (s *BackupService) deleteBackup(backup *Backup) error {
err = storage.DeleteFile(backup.ID)
if err != nil {
- return err
+ // we do not return error here, because sometimes clean up performed
+ // before unavailable storage removal or change - therefore we should
+ // proceed even in case of error
+ s.logger.Error("Failed to delete backup file", "error", err)
}
return s.backupRepository.DeleteByID(backup.ID)