refactor: Update CleanupDatabase.php to adjust keep_days based on environment

This commit is contained in:
Andras Bacsai
2024-08-01 08:52:58 +02:00
parent e8b2d8bf03
commit 35dbced3c5

View File

@@ -18,7 +18,11 @@ class CleanupDatabase extends Command
} else {
echo "Running database cleanup in dry-run mode...\n";
}
$keep_days = 60;
if (isCloud()) {
$keep_days = 30;
} else {
$keep_days = 60;
}
echo "Keep days: $keep_days\n";
// Cleanup failed jobs table
$failed_jobs = DB::table('failed_jobs')->where('failed_at', '<', now()->subDays(1));