mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
webhook instances will not listen to either worker or event log messages on the Redis pub/sub channel
23 lines
781 B
TypeScript
23 lines
781 B
TypeScript
import { Service } from 'typedi';
|
|
import { COMMAND_REDIS_CHANNEL } from '../../redis/RedisServiceHelper';
|
|
import { OrchestrationHandlerService } from '../../orchestration.handler.base.service';
|
|
import { handleCommandMessageWebhook } from './handleCommandMessageWebhook';
|
|
|
|
@Service()
|
|
export class OrchestrationHandlerWebhookService extends OrchestrationHandlerService {
|
|
async initSubscriber() {
|
|
this.redisSubscriber = await this.redisService.getPubSubSubscriber();
|
|
|
|
await this.redisSubscriber.subscribeToCommandChannel();
|
|
|
|
this.redisSubscriber.addMessageHandler(
|
|
'OrchestrationMessageReceiver',
|
|
async (channel: string, messageString: string) => {
|
|
if (channel === COMMAND_REDIS_CHANNEL) {
|
|
await handleCommandMessageWebhook(messageString);
|
|
}
|
|
},
|
|
);
|
|
}
|
|
}
|