fix: function calls

This commit is contained in:
peaklabs-dev
2025-01-13 16:54:17 +01:00
parent f0d15afbf2
commit a5fadb0536
2 changed files with 5 additions and 3 deletions

View File

@@ -124,10 +124,12 @@ class BackupEdit extends Component
try { try {
if ($this->delete_associated_backups_locally) { if ($this->delete_associated_backups_locally) {
deleteOldBackupsLocally($this->backup); $filenames = $this->backup->executions->pluck('filename')->filter()->all();
deleteBackupsLocally($filenames, $this->backup->server);
} }
if ($this->delete_associated_backups_s3 && $this->backup->s3) { if ($this->delete_associated_backups_s3 && $this->backup->s3) {
deleteOldBackupsFromS3($this->backup); $filenames = $this->backup->executions->pluck('filename')->filter()->all();
deleteBackupsS3($filenames, $this->backup->s3);
} }
$this->backup->delete(); $this->backup->delete();

View File

@@ -352,7 +352,7 @@ function deleteOldBackupsFromS3($backup): void
} }
if (! empty($filesToDelete)) { if (! empty($filesToDelete)) {
deleteBackupsS3($filesToDelete, $backup->server, $backup->s3); deleteBackupsS3($filesToDelete, $backup->s3);
if (! empty($executionIds)) { if (! empty($executionIds)) {
$backup->executions() $backup->executions()
->whereIn('id', $executionIds) ->whereIn('id', $executionIds)