mirror of
https://github.com/coollabsio/coolify.git
synced 2026-11-06 21:18:11 -04:00
fix(cloud): refresh local versions.json hourly on every node
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
666ae60c2c
commit
b1f2abf868
@@ -41,6 +41,20 @@ it('schedules ssh mux cleanup locally on every scheduler host', function () {
|
||||
expect($event->getSummaryForDisplay())->toBe('cleanup:ssh-mux');
|
||||
});
|
||||
|
||||
it('refreshes the local versions.json hourly on every cloud node', function (bool $cloud) {
|
||||
config(['constants.coolify.self_hosted' => ! $cloud]);
|
||||
$schedule = app(Schedule::class);
|
||||
|
||||
$event = collect($schedule->events())->first(
|
||||
fn ($e) => (string) $e->description === 'versions:refresh-local'
|
||||
);
|
||||
|
||||
expect($event)->not->toBeNull();
|
||||
expect($event->onOneServer)->toBeFalse();
|
||||
expect($event->expression)->toBe('0 * * * *');
|
||||
expect($event->filtersPass(app()))->toBe($cloud);
|
||||
})->with(['cloud' => true, 'self-hosted' => false]);
|
||||
|
||||
it('schedules every production job with onOneServer', function () {
|
||||
$schedule = app(Schedule::class);
|
||||
|
||||
|
||||
@@ -163,3 +163,11 @@ it('preserves other component versions when preventing Coolify downgrade', funct
|
||||
$job = new CheckForUpdatesJob;
|
||||
$job->handle();
|
||||
});
|
||||
|
||||
it('keeps the local versions.json when the CDN fetch fails', function () {
|
||||
Http::fake(['*' => Http::response('', 500)]);
|
||||
File::shouldReceive('put')->never();
|
||||
Cache::shouldReceive('forget')->never();
|
||||
|
||||
expect(refresh_versions_file())->toBeNull();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user