Skip to content

Commit

Permalink
fix(core): Initialize queue once in queue mode (#8025)
Browse files Browse the repository at this point in the history
We're initializing the queue twice because of a [bad
merge](2c63474).
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.
  • Loading branch information
ivov committed Dec 15, 2023
1 parent cf5c723 commit b1c9c50
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
1 change: 0 additions & 1 deletion packages/cli/src/commands/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down
18 changes: 9 additions & 9 deletions packages/cli/test/integration/commands/worker.cmd.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});

0 comments on commit b1c9c50

Please sign in to comment.