fix(core): Make first queue reconciliation immediate on startup (#18490)

This commit is contained in:
Iván Ovejero
2025-08-19 10:55:52 +02:00
committed by GitHub
parent 06b586af44
commit 961fc538d7
2 changed files with 4 additions and 2 deletions

View File

@@ -118,7 +118,7 @@ describe('ScalingService', () => {
expect(Bull).toHaveBeenCalledWith(...bullConstructorArgs);
expect(registerMainOrWebhookListenersSpy).toHaveBeenCalled();
expect(registerWorkerListenersSpy).not.toHaveBeenCalled();
expect(scheduleQueueRecoverySpy).toHaveBeenCalled();
expect(scheduleQueueRecoverySpy).toHaveBeenCalledWith(0);
});
});

View File

@@ -73,7 +73,7 @@ export class ScalingService {
this.registerListeners();
if (this.instanceSettings.isLeader) this.scheduleQueueRecovery();
if (this.instanceSettings.isLeader) this.scheduleQueueRecovery(0);
this.scheduleQueueMetrics();
@@ -460,6 +460,8 @@ export class ScalingService {
}
}, waitMs);
if (waitMs === 0) return;
const wait = [this.queueRecoveryContext.waitMs / Time.minutes.toMilliseconds, 'min'].join(' ');
this.logger.debug(`Scheduled queue recovery check for next ${wait}`);