mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-11 21:07:28 -08:00
fix(core): Ensure remove-triggers-and-pollers
command is not debounced (#11486)
This commit is contained in:
parent
629e092407
commit
529d4fc3ef
|
@ -65,6 +65,42 @@ describe('Publisher', () => {
|
||||||
JSON.stringify({ ...msg, senderId: hostId, selfSend: false, debounce: true }),
|
JSON.stringify({ ...msg, senderId: hostId, selfSend: false, debounce: true }),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should not debounce `add-webhooks-triggers-and-pollers`', async () => {
|
||||||
|
const publisher = new Publisher(logger, redisClientService, instanceSettings);
|
||||||
|
const msg = mock<PubSub.Command>({ command: 'add-webhooks-triggers-and-pollers' });
|
||||||
|
|
||||||
|
await publisher.publishCommand(msg);
|
||||||
|
|
||||||
|
expect(client.publish).toHaveBeenCalledWith(
|
||||||
|
'n8n.commands',
|
||||||
|
JSON.stringify({
|
||||||
|
...msg,
|
||||||
|
_isMockObject: true,
|
||||||
|
senderId: hostId,
|
||||||
|
selfSend: true,
|
||||||
|
debounce: false,
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should not debounce `remove-triggers-and-pollers`', async () => {
|
||||||
|
const publisher = new Publisher(logger, redisClientService, instanceSettings);
|
||||||
|
const msg = mock<PubSub.Command>({ command: 'remove-triggers-and-pollers' });
|
||||||
|
|
||||||
|
await publisher.publishCommand(msg);
|
||||||
|
|
||||||
|
expect(client.publish).toHaveBeenCalledWith(
|
||||||
|
'n8n.commands',
|
||||||
|
JSON.stringify({
|
||||||
|
...msg,
|
||||||
|
_isMockObject: true,
|
||||||
|
senderId: hostId,
|
||||||
|
selfSend: true,
|
||||||
|
debounce: false,
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('publishWorkerResponse', () => {
|
describe('publishWorkerResponse', () => {
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import type { PubSub } from './pubsub/pubsub.types';
|
||||||
|
|
||||||
export const QUEUE_NAME = 'jobs';
|
export const QUEUE_NAME = 'jobs';
|
||||||
|
|
||||||
export const JOB_TYPE_NAME = 'job';
|
export const JOB_TYPE_NAME = 'job';
|
||||||
|
@ -11,7 +13,7 @@ export const WORKER_RESPONSE_PUBSUB_CHANNEL = 'n8n.worker-response';
|
||||||
/**
|
/**
|
||||||
* Commands that should be sent to the sender as well, e.g. during workflow activation and
|
* Commands that should be sent to the sender as well, e.g. during workflow activation and
|
||||||
* deactivation in multi-main setup. */
|
* deactivation in multi-main setup. */
|
||||||
export const SELF_SEND_COMMANDS = new Set([
|
export const SELF_SEND_COMMANDS = new Set<PubSub.Command['command']>([
|
||||||
'add-webhooks-triggers-and-pollers',
|
'add-webhooks-triggers-and-pollers',
|
||||||
'remove-triggers-and-pollers',
|
'remove-triggers-and-pollers',
|
||||||
]);
|
]);
|
||||||
|
@ -20,7 +22,8 @@ export const SELF_SEND_COMMANDS = new Set([
|
||||||
* Commands that should not be debounced when received, e.g. during webhook handling in
|
* Commands that should not be debounced when received, e.g. during webhook handling in
|
||||||
* multi-main setup.
|
* multi-main setup.
|
||||||
*/
|
*/
|
||||||
export const IMMEDIATE_COMMANDS = new Set([
|
export const IMMEDIATE_COMMANDS = new Set<PubSub.Command['command']>([
|
||||||
'add-webhooks-triggers-and-pollers',
|
'add-webhooks-triggers-and-pollers',
|
||||||
|
'remove-triggers-and-pollers',
|
||||||
'relay-execution-lifecycle-event',
|
'relay-execution-lifecycle-event',
|
||||||
]);
|
]);
|
||||||
|
|
Loading…
Reference in a new issue