mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-24 04:04:06 -08:00
fix(AMQP Trigger Node): Properly close connection after manual test step (#8396)
This commit is contained in:
parent
daba5bb250
commit
2c14371481
|
@ -48,16 +48,18 @@ export class AmqpTrigger implements INodeType {
|
||||||
name: 'clientname',
|
name: 'clientname',
|
||||||
type: 'string',
|
type: 'string',
|
||||||
default: '',
|
default: '',
|
||||||
placeholder: 'for durable/persistent topic subscriptions, example: "n8n"',
|
placeholder: 'e.g. n8n',
|
||||||
description: 'Leave empty for non-durable topic subscriptions or queues',
|
description: 'Leave empty for non-durable topic subscriptions or queues',
|
||||||
|
hint: 'for durable/persistent topic subscriptions',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Subscription',
|
displayName: 'Subscription',
|
||||||
name: 'subscription',
|
name: 'subscription',
|
||||||
type: 'string',
|
type: 'string',
|
||||||
default: '',
|
default: '',
|
||||||
placeholder: 'for durable/persistent topic subscriptions, example: "order-worker"',
|
placeholder: 'e.g. order-worker',
|
||||||
description: 'Leave empty for non-durable topic subscriptions or queues',
|
description: 'Leave empty for non-durable topic subscriptions or queues',
|
||||||
|
hint: 'for durable/persistent topic subscriptions',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Options',
|
displayName: 'Options',
|
||||||
|
@ -270,6 +272,10 @@ export class AmqpTrigger implements INodeType {
|
||||||
const manualTriggerFunction = async () => {
|
const manualTriggerFunction = async () => {
|
||||||
await new Promise((resolve, reject) => {
|
await new Promise((resolve, reject) => {
|
||||||
const timeoutHandler = setTimeout(() => {
|
const timeoutHandler = setTimeout(() => {
|
||||||
|
container.removeAllListeners('receiver_open');
|
||||||
|
container.removeAllListeners('message');
|
||||||
|
connection.close();
|
||||||
|
|
||||||
reject(
|
reject(
|
||||||
new Error(
|
new Error(
|
||||||
'Aborted, no message received within 30secs. This 30sec timeout is only set for "manually triggered execution". Active Workflows will listen indefinitely.',
|
'Aborted, no message received within 30secs. This 30sec timeout is only set for "manually triggered execution". Active Workflows will listen indefinitely.',
|
||||||
|
|
Loading…
Reference in a new issue