mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-24 04:04:06 -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);
|
||||
if (webhookExists === false) {
|
||||
// If webhook does not exist yet create it
|
||||
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);
|
||||
|
|
Loading…
Reference in a new issue