mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
fix(core): Make senderId required for all command messages (#7252)
all commands sent between main instance and workers need to contain a server id to prevent senders from reacting to their own messages, causing loops this PR makes sure all sent messages contain a sender id by default as part of constructing a sending redis client. --------- Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
This commit is contained in:
committed by
GitHub
parent
77d6e3fc07
commit
4b014286cf
@@ -2,6 +2,7 @@ import type Redis from 'ioredis';
|
||||
import type { Cluster } from 'ioredis';
|
||||
import { getDefaultRedisClient } from './RedisServiceHelper';
|
||||
import { LoggerProxy } from 'n8n-workflow';
|
||||
import config from '@/config';
|
||||
|
||||
export type RedisClientType =
|
||||
| 'subscriber'
|
||||
@@ -57,8 +58,9 @@ class RedisServiceBase {
|
||||
export abstract class RedisServiceBaseSender extends RedisServiceBase {
|
||||
senderId: string;
|
||||
|
||||
setSenderId(senderId?: string): void {
|
||||
this.senderId = senderId ?? '';
|
||||
async init(type: RedisClientType = 'client'): Promise<void> {
|
||||
await super.init(type);
|
||||
this.senderId = config.get('redis.queueModeId');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user