mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-11 12:57:29 -08:00
🐛 Fix bug with test webhooks which do not get unregistered
This commit is contained in:
parent
725d2d16fc
commit
f64a49318a
|
@ -53,7 +53,15 @@ export class ActiveWebhooks {
|
||||||
const webhookExists = await workflow.runWebhookMethod('checkExists', webhookData, NodeExecuteFunctions, mode, this.testWebhooks);
|
const webhookExists = await workflow.runWebhookMethod('checkExists', webhookData, NodeExecuteFunctions, mode, this.testWebhooks);
|
||||||
if (webhookExists === false) {
|
if (webhookExists === false) {
|
||||||
// If webhook does not exist yet create it
|
// If webhook does not exist yet create it
|
||||||
await workflow.runWebhookMethod('create', webhookData, NodeExecuteFunctions, mode, this.testWebhooks);
|
try {
|
||||||
|
await workflow.runWebhookMethod('create', webhookData, NodeExecuteFunctions, mode, this.testWebhooks);
|
||||||
|
} catch (error) {
|
||||||
|
// If there was a problem unregister the webhook again
|
||||||
|
delete this.webhookUrls[webhookKey];
|
||||||
|
delete this.workflowWebhooks[webhookData.workflowId];
|
||||||
|
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.workflowWebhooks[webhookData.workflowId].push(webhookData);
|
this.workflowWebhooks[webhookData.workflowId].push(webhookData);
|
||||||
|
|
Loading…
Reference in a new issue