fix: cleanup old scheduled_task_executions

This commit is contained in:
Andras Bacsai
2025-01-28 10:19:41 +01:00
parent fddaf9134d
commit bfe4200012

View File

@@ -57,6 +57,14 @@ class CleanupDatabase extends Command
$application_deployment_queues->delete();
}
// Cleanup scheduled_task_executions table
$scheduled_task_executions = DB::table('scheduled_task_executions')->where('created_at', '<', now()->subDays($keep_days))->orderBy('created_at', 'desc');
$count = $scheduled_task_executions->count();
echo "Delete $count entries from scheduled_task_executions.\n";
if ($this->option('yes')) {
$scheduled_task_executions->delete();
}
// Cleanup webhooks table
$webhooks = DB::table('webhooks')->where('created_at', '<', now()->subDays($keep_days));
$count = $webhooks->count();