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:
Andras Bacsai
2026-10-03 21:25:00 +02:00
parent edf1ab03a7
commit a3ed963aed
5 changed files with 173 additions and 21 deletions
@@ -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();