1
1
mirror of https://github.com/n8n-io/n8n.git synced 2024-07-15 00:40:33 +03:00

fix(core): Fix worker logs relay (#9919)

This commit is contained in:
Iván Ovejero 2024-07-03 10:29:25 +02:00 committed by GitHub
parent e6ad5a7193
commit 7c53433191
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 0 deletions

View File

@ -29,6 +29,7 @@ import type { WorkerJobStatusSummary } from '@/services/orchestration/worker/typ
import { ServiceUnavailableError } from '@/errors/response-errors/service-unavailable.error';
import { BaseCommand } from './BaseCommand';
import { MaxStalledCountError } from '@/errors/max-stalled-count.error';
import { AuditEventRelay } from '@/eventbus/audit-event-relay.service';
export class Worker extends BaseCommand {
static description = '\nStarts a n8n worker';
@ -287,6 +288,7 @@ export class Worker extends BaseCommand {
await Container.get(MessageEventBus).initialize({
workerId: this.queueModeId,
});
Container.get(AuditEventRelay).init();
}
/**

View File

@ -15,6 +15,7 @@ import { type JobQueue, Queue } from '@/Queue';
import { setupTestCommand } from '@test-integration/utils/testCommand';
import { mockInstance } from '../../shared/mocking';
import { AuditEventRelay } from '@/eventbus/audit-event-relay.service';
config.set('executions.mode', 'queue');
config.set('binaryDataManager.availableModes', 'filesystem');
@ -25,6 +26,7 @@ const externalHooks = mockInstance(ExternalHooks);
const externalSecretsManager = mockInstance(ExternalSecretsManager);
const license = mockInstance(License);
const messageEventBus = mockInstance(MessageEventBus);
const auditEventRelay = mockInstance(AuditEventRelay);
const orchestrationHandlerWorkerService = mockInstance(OrchestrationHandlerWorkerService);
const queue = mockInstance(Queue);
const orchestrationWorkerService = mockInstance(OrchestrationWorkerService);
@ -43,6 +45,7 @@ test('worker initializes all its components', async () => {
expect(externalHooks.init).toHaveBeenCalledTimes(1);
expect(externalSecretsManager.init).toHaveBeenCalledTimes(1);
expect(messageEventBus.initialize).toHaveBeenCalledTimes(1);
expect(auditEventRelay.init).toHaveBeenCalledTimes(1);
expect(queue.init).toHaveBeenCalledTimes(1);
expect(queue.process).toHaveBeenCalledTimes(1);
expect(orchestrationWorkerService.init).toHaveBeenCalledTimes(1);