mirror of
https://github.com/n8n-io/n8n.git
synced 2024-08-17 09:00:30 +03:00
fix(core): Fix worker logs relay (#9919)
This commit is contained in:
parent
e6ad5a7193
commit
7c53433191
@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user