fix(webhooks): connect receiver to cache metrics for polling optimization (Phase 5.1)
All checks were successful
All checks were successful
This commit is contained in:
@@ -167,6 +167,13 @@ router.post('/sonarr', (req, res) => {
|
||||
logToFile(`[Webhook] Sonarr event received - Type: ${eventType || 'unknown'}, Instance: ${instanceName || 'unknown'}`);
|
||||
logToFile(`[Webhook] Sonarr payload: ${JSON.stringify(req.body)}`);
|
||||
|
||||
// Phase 5.1: update webhook metrics for polling optimization
|
||||
const sonarrInstances = getSonarrInstances();
|
||||
const instance = sonarrInstances.find(i => i.name === instanceName);
|
||||
if (instance) {
|
||||
cache.updateWebhookMetrics(instance.url);
|
||||
}
|
||||
|
||||
// Phase 2: background cache refresh + SSE broadcast (fire-and-forget)
|
||||
processWebhookEvent('sonarr', eventType).catch(err => {
|
||||
logToFile(`[Webhook] Sonarr background refresh error: ${err.message}`);
|
||||
@@ -196,6 +203,13 @@ router.post('/radarr', (req, res) => {
|
||||
logToFile(`[Webhook] Radarr event received - Type: ${eventType || 'unknown'}, Instance: ${instanceName || 'unknown'}`);
|
||||
logToFile(`[Webhook] Radarr payload: ${JSON.stringify(req.body)}`);
|
||||
|
||||
// Phase 5.1: update webhook metrics for polling optimization
|
||||
const radarrInstances = getRadarrInstances();
|
||||
const instance = radarrInstances.find(i => i.name === instanceName);
|
||||
if (instance) {
|
||||
cache.updateWebhookMetrics(instance.url);
|
||||
}
|
||||
|
||||
// Phase 2: background cache refresh + SSE broadcast (fire-and-forget)
|
||||
processWebhookEvent('radarr', eventType).catch(err => {
|
||||
logToFile(`[Webhook] Radarr background refresh error: ${err.message}`);
|
||||
|
||||
Reference in New Issue
Block a user