From 980e20247c08ac4365f30905be9c526472bae37a Mon Sep 17 00:00:00 2001 From: Gronod Date: Sat, 16 May 2026 00:14:12 +0100 Subject: [PATCH] perf: reduce history page sizes and drop includeEpisode - Sonarr/Radarr history: pageSize 20 -> 10 - SABnzbd history: limit 20 -> 10 - Drop includeEpisode from Sonarr queue and history (never rendered) - These reduce DB join overhead and response payload size --- server/utils/poller.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/server/utils/poller.js b/server/utils/poller.js index 95d3b52..ac5d849 100644 --- a/server/utils/poller.js +++ b/server/utils/poller.js @@ -48,7 +48,7 @@ async function pollAllServices() { ))), timed('SABnzbd History', () => Promise.all(sabInstances.map(inst => axios.get(`${inst.url}/api`, { - params: { mode: 'history', apikey: inst.apiKey, output: 'json', limit: 20 } + params: { mode: 'history', apikey: inst.apiKey, output: 'json', limit: 10 } }).then(res => ({ instance: inst.id, data: res.data })).catch(err => { console.error(`[Poller] SABnzbd ${inst.id} history error:`, err.message); return { instance: inst.id, data: { history: { slots: [] } } }; @@ -65,7 +65,7 @@ async function pollAllServices() { timed('Sonarr Queue', () => Promise.all(sonarrInstances.map(inst => axios.get(`${inst.url}/api/v3/queue`, { headers: { 'X-Api-Key': inst.apiKey }, - params: { includeSeries: true, includeEpisode: true } + params: { includeSeries: true } }).then(res => ({ instance: inst.id, data: res.data })).catch(err => { console.error(`[Poller] Sonarr ${inst.id} queue error:`, err.message); return { instance: inst.id, data: { records: [] } }; @@ -74,7 +74,7 @@ async function pollAllServices() { timed('Sonarr History', () => Promise.all(sonarrInstances.map(inst => axios.get(`${inst.url}/api/v3/history`, { headers: { 'X-Api-Key': inst.apiKey }, - params: { pageSize: 20, includeSeries: true, includeEpisode: true } + params: { pageSize: 10, includeSeries: true } }).then(res => ({ instance: inst.id, data: res.data })).catch(err => { console.error(`[Poller] Sonarr ${inst.id} history error:`, err.message); return { instance: inst.id, data: { records: [] } }; @@ -92,7 +92,7 @@ async function pollAllServices() { timed('Radarr History', () => Promise.all(radarrInstances.map(inst => axios.get(`${inst.url}/api/v3/history`, { headers: { 'X-Api-Key': inst.apiKey }, - params: { pageSize: 20, includeMovie: true } + params: { pageSize: 10, includeMovie: true } }).then(res => ({ instance: inst.id, data: res.data })).catch(err => { console.error(`[Poller] Radarr ${inst.id} history error:`, err.message); return { instance: inst.id, data: { records: [] } };