mirror of
https://github.com/coollabsio/coolify.git
synced 2026-11-06 13:10:37 -04:00
fix(server): stagger Sentinel version and patch checks per server
Servers no longer all connect at minute 0. The hourly Sentinel check uses a per-server minute, and the weekly patch check uses a per-server time on Sunday between 04:00 and 23:59.
This commit is contained in:
@@ -16,6 +16,7 @@ use Tests\TestCase;
|
||||
uses(TestCase::class, RefreshDatabase::class);
|
||||
|
||||
beforeEach(function () {
|
||||
Server::flushIdentityMap();
|
||||
Queue::fake();
|
||||
Carbon::setTestNow('2025-01-15 12:00:00');
|
||||
InstanceSettings::forceCreate(['id' => 0, 'instance_timezone' => 'UTC']);
|
||||
@@ -45,6 +46,8 @@ function createSentinelCheckServer(Team $team, Carbon $sentinelUpdatedAt, Server
|
||||
|
||||
it('dispatches an hourly Sentinel version check for a healthy Sentinel', function () {
|
||||
$server = createSentinelCheckServer($this->team, Carbon::now());
|
||||
Carbon::setTestNow(Carbon::now()->setMinute($server->id % 60));
|
||||
$server->update(['sentinel_updated_at' => Carbon::now()]);
|
||||
|
||||
expect($server->isSentinelEnabled())->toBeTrue()
|
||||
->and($server->isSentinelLive())->toBeTrue();
|
||||
|
||||
Reference in New Issue
Block a user