fix s3 is always set to true if you make an error like invalid cron

This commit is contained in:
peaklabs-dev
2024-11-14 18:25:04 +01:00
parent b282c1f3ed
commit 67bd06d4f2

View File

@@ -49,6 +49,7 @@ class CreateScheduledBackup extends Component
return;
}
$payload = [
'enabled' => true,
'frequency' => $this->frequency,
@@ -58,6 +59,7 @@ class CreateScheduledBackup extends Component
'database_type' => $this->database->getMorphClass(),
'team_id' => currentTeam()->id,
];
if ($this->database->type() === 'standalone-postgresql') {
$payload['databases_to_backup'] = $this->database->postgres_db;
} elseif ($this->database->type() === 'standalone-mysql') {
@@ -72,11 +74,11 @@ class CreateScheduledBackup extends Component
} else {
$this->dispatch('refreshScheduledBackups');
}
$this->frequency = '';
} catch (\Throwable $e) {
return handleError($e, $this);
} finally {
$this->frequency = '';
$this->saveToS3 = true;
}
}
}