fix: backup job deletion - delete all backups from s3 and local

This commit is contained in:
peaklabs-dev
2025-01-13 17:31:55 +01:00
parent c03b629e85
commit 3dfca4e4bd
2 changed files with 30 additions and 10 deletions

View File

@@ -62,10 +62,12 @@ class BackupExecutions extends Component
: $execution->scheduledDatabaseBackup->database->destination->server;
try {
deleteBackupsLocally($execution->filename, $server);
if ($execution->filename) {
deleteBackupsLocally($execution->filename, $server);
if ($this->delete_backup_s3 && $execution->scheduledDatabaseBackup->s3) {
deleteBackupsS3($execution->filename, $execution->scheduledDatabaseBackup->s3);
if ($this->delete_backup_s3 && $execution->scheduledDatabaseBackup->s3) {
deleteBackupsS3($execution->filename, $execution->scheduledDatabaseBackup->s3);
}
}
$execution->delete();