mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
🐛 Remove Test-Webhook also if checkExists fails
This commit is contained in:
@@ -50,11 +50,13 @@ export class ActiveWebhooks {
|
||||
// it gets called
|
||||
this.webhookUrls[webhookKey] = webhookData;
|
||||
|
||||
try {
|
||||
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];
|
||||
@@ -62,8 +64,6 @@ export class ActiveWebhooks {
|
||||
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
this.workflowWebhooks[webhookData.workflowId].push(webhookData);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user