mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-24 04:04:06 -08:00
🐛 Remove Test-Webhook also if checkExists fails
This commit is contained in:
parent
685aa2cf82
commit
f56960f0cc
|
@ -50,20 +50,20 @@ export class ActiveWebhooks {
|
||||||
// it gets called
|
// it gets called
|
||||||
this.webhookUrls[webhookKey] = webhookData;
|
this.webhookUrls[webhookKey] = webhookData;
|
||||||
|
|
||||||
const webhookExists = await workflow.runWebhookMethod('checkExists', webhookData, NodeExecuteFunctions, mode, this.testWebhooks);
|
try {
|
||||||
if (webhookExists === false) {
|
const webhookExists = await workflow.runWebhookMethod('checkExists', webhookData, NodeExecuteFunctions, mode, this.testWebhooks);
|
||||||
// If webhook does not exist yet create it
|
if (webhookExists === false) {
|
||||||
try {
|
// If webhook does not exist yet create it
|
||||||
await workflow.runWebhookMethod('create', webhookData, NodeExecuteFunctions, mode, this.testWebhooks);
|
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;
|
|
||||||
}
|
}
|
||||||
}
|
} 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