Merge branch 'next' into fix-deployment-skipped-message

This commit is contained in:
Andras Bacsai 2025-11-10 21:33:10 +01:00
commit a12dd98f64
2 changed files with 11 additions and 5 deletions

View file

@ -222,9 +222,14 @@ private function cleanup_stucked_resources()
try { try {
$scheduled_backups = ScheduledDatabaseBackup::all(); $scheduled_backups = ScheduledDatabaseBackup::all();
foreach ($scheduled_backups as $scheduled_backup) { foreach ($scheduled_backups as $scheduled_backup) {
if (! $scheduled_backup->server()) { try {
echo "Deleting stuck scheduledbackup: {$scheduled_backup->name}\n"; $server = $scheduled_backup->server();
$scheduled_backup->delete(); if (! $server) {
echo "Deleting stuck scheduledbackup: {$scheduled_backup->name}\n";
$scheduled_backup->delete();
}
} catch (\Throwable $e) {
echo "Error checking server for scheduledbackup {$scheduled_backup->id}: {$e->getMessage()}\n";
} }
} }
} catch (\Throwable $e) { } catch (\Throwable $e) {
@ -416,7 +421,7 @@ private function cleanup_stucked_resources()
foreach ($serviceApplications as $service) { foreach ($serviceApplications as $service) {
if (! data_get($service, 'service')) { if (! data_get($service, 'service')) {
echo 'ServiceApplication without service: '.$service->name.'\n'; echo 'ServiceApplication without service: '.$service->name.'\n';
DeleteResourceJob::dispatch($service); $service->forceDelete();
continue; continue;
} }
@ -429,7 +434,7 @@ private function cleanup_stucked_resources()
foreach ($serviceDatabases as $service) { foreach ($serviceDatabases as $service) {
if (! data_get($service, 'service')) { if (! data_get($service, 'service')) {
echo 'ServiceDatabase without service: '.$service->name.'\n'; echo 'ServiceDatabase without service: '.$service->name.'\n';
DeleteResourceJob::dispatch($service); $service->forceDelete();
continue; continue;
} }

View file

@ -86,6 +86,7 @@ public function handle()
$this->call('cleanup:stucked-resources'); $this->call('cleanup:stucked-resources');
} catch (\Throwable $e) { } catch (\Throwable $e) {
echo "Error in cleanup:stucked-resources command: {$e->getMessage()}\n"; echo "Error in cleanup:stucked-resources command: {$e->getMessage()}\n";
echo "Continuing with initialization - cleanup errors will not prevent Coolify from starting\n";
} }
try { try {
$updatedCount = ApplicationDeploymentQueue::whereIn('status', [ $updatedCount = ApplicationDeploymentQueue::whereIn('status', [