From 1d0d6b4a79f3280584ffb57409bdc4e309cb7dd0 Mon Sep 17 00:00:00 2001 From: Andras Bacsai <5845193+andrasbacsai@users.noreply.github.com> Date: Thu, 3 Sep 2026 19:23:08 +0200 Subject: [PATCH] fix(scheduler): run stuck resource cleanup in background at 03:17 Bump the Coolify release version to 4.3.16 and update schedule coverage. --- app/Console/Kernel.php | 5 +++-- config/constants.php | 2 +- other/nightly/versions.json | 2 +- tests/Feature/ScheduleOnOneServerTest.php | 8 +++++--- tests/Unit/ProductionImageWorkflowTest.php | 4 ++-- versions.json | 2 +- 6 files changed, 13 insertions(+), 10 deletions(-) diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index 8d4d017c8..8eb010b8a 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -47,9 +47,10 @@ protected function schedule(Schedule $schedule): void ->when(fn () => config('constants.ssh.mux_enabled') && ! config('constants.coolify.is_windows_docker_desktop')); $this->scheduleInstance->command('cleanup:redis --clear-locks')->daily(); $this->scheduleInstance->command('cleanup:stucked-resources') - ->daily() + ->dailyAt('03:17') ->onOneServer() - ->withoutOverlapping(60); + ->withoutOverlapping(60) + ->runInBackground(); $this->scheduleInstance->command('sanctum:prune-expired --hours=1')->hourly()->onOneServer(); $this->scheduleInstance->job(new ApiTokenExpirationWarningJob)->hourly()->onOneServer(); diff --git a/config/constants.php b/config/constants.php index 457a8a1ff..d2e2a9f33 100644 --- a/config/constants.php +++ b/config/constants.php @@ -2,7 +2,7 @@ return [ 'coolify' => [ - 'version' => env('COOLIFY_VERSION') ?: '4.3.15', + 'version' => env('COOLIFY_VERSION') ?: '4.3.16', 'helper_version' => '1.0.16', 'realtime_version' => '1.0.18', 'railpack_version' => '0.23.0', diff --git a/other/nightly/versions.json b/other/nightly/versions.json index 455918fdc..a3a660f9c 100644 --- a/other/nightly/versions.json +++ b/other/nightly/versions.json @@ -1,7 +1,7 @@ { "coolify": { "v4": { - "version": "4.3.15" + "version": "4.3.16" }, "nightly": { "version": "4.4-rc.1" diff --git a/tests/Feature/ScheduleOnOneServerTest.php b/tests/Feature/ScheduleOnOneServerTest.php index ef2d80e64..3ad380863 100644 --- a/tests/Feature/ScheduleOnOneServerTest.php +++ b/tests/Feature/ScheduleOnOneServerTest.php @@ -59,7 +59,7 @@ expect($event)->toBeNull(); }); -it('schedules stuck resource cleanup once per day on one server', function () { +it('schedules stuck resource cleanup in the background once per day', function () { $schedule = app(Schedule::class); $event = collect($schedule->events())->first( @@ -67,6 +67,8 @@ ); expect($event)->not->toBeNull() - ->and($event->expression)->toBe('0 0 * * *') - ->and($event->onOneServer)->toBeTrue(); + ->and($event->expression)->toBe('17 3 * * *') + ->and($event->onOneServer)->toBeTrue() + ->and($event->withoutOverlapping)->toBeTrue() + ->and($event->runInBackground)->toBeTrue(); }); diff --git a/tests/Unit/ProductionImageWorkflowTest.php b/tests/Unit/ProductionImageWorkflowTest.php index 293c9422e..4e6229d07 100644 --- a/tests/Unit/ProductionImageWorkflowTest.php +++ b/tests/Unit/ProductionImageWorkflowTest.php @@ -23,8 +23,8 @@ ->toContain('ARG COOLIFY_VERSION') ->toContain('ENV COOLIFY_VERSION=${COOLIFY_VERSION}') ->and($constants) - ->toContain("'version' => env('COOLIFY_VERSION') ?: '4.3.15'") - ->and($versions['coolify']['v4']['version'])->toBe('4.3.15') + ->toContain("'version' => env('COOLIFY_VERSION') ?: '4.3.16'") + ->and($versions['coolify']['v4']['version'])->toBe('4.3.16') ->and($versions['coolify']['nightly']['version'])->toBe('4.4-rc.1') ->and($nightlyVersions)->toBe($versions); }); diff --git a/versions.json b/versions.json index 455918fdc..a3a660f9c 100644 --- a/versions.json +++ b/versions.json @@ -1,7 +1,7 @@ { "coolify": { "v4": { - "version": "4.3.15" + "version": "4.3.16" }, "nightly": { "version": "4.4-rc.1"