🐛 Fix bug with test webhooks which do not get unregistered

This commit is contained in:
Jan Oberhauser 2020-07-24 13:56:20 +02:00
parent 725d2d16fc
commit f64a49318a

View file

@ -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);