mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-21 03:42:16 +00:00
fix(core): Do not cache dynamic webhooks (#15176)
This commit is contained in:
@@ -41,19 +41,18 @@ export class WebhookService {
|
||||
private async findCached(method: Method, path: string) {
|
||||
const cacheKey = `webhook:${method}-${path}`;
|
||||
|
||||
const cachedWebhook = await this.cacheService.get(cacheKey);
|
||||
const cachedStaticWebhook = await this.cacheService.get(cacheKey);
|
||||
|
||||
if (cachedWebhook) return this.webhookRepository.create(cachedWebhook);
|
||||
if (cachedStaticWebhook) return this.webhookRepository.create(cachedStaticWebhook);
|
||||
|
||||
let dbWebhook = await this.findStaticWebhook(method, path);
|
||||
const dbStaticWebhook = await this.findStaticWebhook(method, path);
|
||||
|
||||
if (dbWebhook === null) {
|
||||
dbWebhook = await this.findDynamicWebhook(method, path);
|
||||
if (dbStaticWebhook) {
|
||||
void this.cacheService.set(cacheKey, dbStaticWebhook);
|
||||
return dbStaticWebhook;
|
||||
}
|
||||
|
||||
void this.cacheService.set(cacheKey, dbWebhook);
|
||||
|
||||
return dbWebhook;
|
||||
return await this.findDynamicWebhook(method, path);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user