mirror of
https://github.com/tiennm99/coolify.git
synced 2026-08-07 10:21:35 +00:00
fix(backups): enforce retention and clean up stale executions
Add `WithoutOverlapping` middleware to `DatabaseBackupJob` keyed by backup ID with timeout-based lock expiry to prevent concurrent runs. Mark long-running backup executions as failed when they exceed the stale time threshold, and add periodic retention enforcement in `CleanupInstanceStuffsJob` with cache-based throttling. Also add float casts for retention max-storage fields on `ScheduledDatabaseBackup` and comprehensive feature tests covering overlap middleware, stale detection, casts, and retention behavior.
This commit is contained in:
@@ -8,6 +8,14 @@ use Illuminate\Database\Eloquent\Relations\MorphTo;
|
||||
|
||||
class ScheduledDatabaseBackup extends BaseModel
|
||||
{
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'database_backup_retention_max_storage_locally' => 'float',
|
||||
'database_backup_retention_max_storage_s3' => 'float',
|
||||
];
|
||||
}
|
||||
|
||||
protected $fillable = [
|
||||
'uuid',
|
||||
'team_id',
|
||||
|
||||
Reference in New Issue
Block a user