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
34 lines
937 B
TypeScript
34 lines
937 B
TypeScript
import Container from 'typedi';
|
|
import type { WorkerCommandReceivedHandlerOptions } from './orchestration/worker/handleCommandMessageWorker';
|
|
import { RedisService } from './redis.service';
|
|
import type { RedisServicePubSubSubscriber } from './redis/RedisServicePubSubSubscriber';
|
|
|
|
export abstract class OrchestrationHandlerService {
|
|
protected initialized = false;
|
|
|
|
redisSubscriber: RedisServicePubSubSubscriber;
|
|
|
|
readonly redisService: RedisService;
|
|
|
|
constructor() {
|
|
this.redisService = Container.get(RedisService);
|
|
}
|
|
|
|
async init() {
|
|
await this.initSubscriber();
|
|
this.initialized = true;
|
|
}
|
|
|
|
async initWithOptions(options: WorkerCommandReceivedHandlerOptions) {
|
|
await this.initSubscriber(options);
|
|
this.initialized = true;
|
|
}
|
|
|
|
async shutdown() {
|
|
await this.redisSubscriber?.destroy();
|
|
this.initialized = false;
|
|
}
|
|
|
|
protected abstract initSubscriber(options?: WorkerCommandReceivedHandlerOptions): Promise<void>;
|
|
}
|