perf(core): Populate cache only with static webhooks (#16048)

This commit is contained in:
Iván Ovejero
2025-06-05 12:02:06 +02:00
committed by GitHub
parent 07b12a41a4
commit a18822af0e
2 changed files with 12 additions and 4 deletions

View File

@@ -32,11 +32,11 @@ export class WebhookService {
) {}
async populateCache() {
const allWebhooks = await this.webhookRepository.find();
const staticWebhooks = await this.webhookRepository.getStaticWebhooks();
if (!allWebhooks) return;
if (staticWebhooks.length === 0) return;
void this.cacheService.setMany(allWebhooks.map((w) => [w.cacheKey, w]));
void this.cacheService.setMany(staticWebhooks.map((w) => [w.cacheKey, w]));
}
async findAll() {