mirror of
https://github.com/coollabsio/coolify.git
synced 2026-11-13 00:03:47 -04:00
fix(cleanup): delete failed database backup records after the retention days
Backup retention removes only successful runs, so failed runs stayed in scheduled_database_backup_executions forever. A failed run has no local file and no S3 copy, so the daily database cleanup can delete its record. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
30335d8086
commit
cd8abbf7b4
@@ -0,0 +1,6 @@
|
||||
---
|
||||
type: fixed
|
||||
---
|
||||
Kept the records of failed database backups forever
|
||||
|
||||
- The daily database cleanup deletes failed database backups that are older than 60 days
|
||||
@@ -48,6 +48,10 @@ class CleanupDatabase extends Command
|
||||
|
||||
$this->cleanupTable('scheduled_task_executions', 'created_at', now()->subDays($keep_days));
|
||||
|
||||
// Backup retention removes only successful runs. A failed run has no file, so only its record is left.
|
||||
$this->cleanupTable('scheduled_database_backup_executions', 'created_at', now()->subDays($keep_days), fn (Builder $query) => $query
|
||||
->where('status', 'failed'));
|
||||
|
||||
$this->cleanupTable('github_runner_executions', 'created_at', now()->subDays($keep_days), fn (Builder $query) => $query
|
||||
->whereNotIn('status', array_map(fn (GithubRunnerStatus $status): string => $status->value, GithubRunnerStatus::active())));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user