fix(core): Initialize queue once in queue mode (#8025)

We're initializing the queue twice because of a [bad
merge](2c63474538).
No associated known bugs but no need to init the queue twice. We should
follow up by investigating if any pending bugs can be associated to
this.
This commit is contained in:
Iván Ovejero 2023-12-14 16:16:12 +01:00 committed by GitHub
parent 329e5bf9ee
commit 53c0b49d15
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 10 deletions

View file

@ -292,7 +292,6 @@ export class Worker extends BaseCommand {
this.logger.debug('Queue init complete');
await this.initOrchestration();
this.logger.debug('Orchestration init complete');
await this.initQueue();
await Container.get(OrchestrationWorkerService).publishToEventLog(
new EventMessageGeneric({

View file

@ -65,15 +65,15 @@ test('worker initializes all its components', async () => {
expect(worker.queueModeId).toBeDefined();
expect(worker.queueModeId).toContain('worker');
expect(worker.queueModeId.length).toBeGreaterThan(15);
expect(worker.initLicense).toHaveBeenCalled();
expect(worker.initBinaryDataService).toHaveBeenCalled();
expect(worker.initExternalHooks).toHaveBeenCalled();
expect(worker.initExternalSecrets).toHaveBeenCalled();
expect(worker.initEventBus).toHaveBeenCalled();
expect(worker.initOrchestration).toHaveBeenCalled();
expect(OrchestrationHandlerWorkerService.prototype.initSubscriber).toHaveBeenCalled();
expect(OrchestrationWorkerService.prototype.publishToEventLog).toHaveBeenCalled();
expect(worker.initQueue).toHaveBeenCalled();
expect(worker.initLicense).toHaveBeenCalledTimes(1);
expect(worker.initBinaryDataService).toHaveBeenCalledTimes(1);
expect(worker.initExternalHooks).toHaveBeenCalledTimes(1);
expect(worker.initExternalSecrets).toHaveBeenCalledTimes(1);
expect(worker.initEventBus).toHaveBeenCalledTimes(1);
expect(worker.initOrchestration).toHaveBeenCalledTimes(1);
expect(OrchestrationHandlerWorkerService.prototype.initSubscriber).toHaveBeenCalledTimes(1);
expect(OrchestrationWorkerService.prototype.publishToEventLog).toHaveBeenCalledTimes(1);
expect(worker.initQueue).toHaveBeenCalledTimes(1);
jest.restoreAllMocks();
});