Put the provider pool on the background refresh timer at startup #4

Merged
namillis merged 1 commit from fix/pool-refresh-on-start into main 2026-10-09 20:01:04 +00:00
Owner

PR #2 added a 5-minute timer that refreshes addons used in the last 7 days, but an addon only joined it after serving a catalog. The set lives in memory, so every restart (including every autodeploy) emptied it. If nobody opened a catalog after a restart, the pool went back to refreshing only on request and its guides went stale again.

createPoolAddon now calls markUsed(pool) right after the initial load, so the pool is on the timer from the moment the server starts. Refresh frequency is unchanged: the pool still refreshes only when needsRefresh says its data is due (hourly with EPG_REFRESH_MS). Per-user token addons are unchanged and still join the timer on their first catalog request.

Tested in the running container by building the pool through createPoolAddon with every refresh stubbed, so no providers were contacted. The pool is on the timer straight after startup with no catalog request, a fresh pool is skipped, and a stale one is refreshed. The same test fails on current main.

PR #2 added a 5-minute timer that refreshes addons used in the last 7 days, but an addon only joined it after serving a catalog. The set lives in memory, so every restart (including every autodeploy) emptied it. If nobody opened a catalog after a restart, the pool went back to refreshing only on request and its guides went stale again. `createPoolAddon` now calls `markUsed(pool)` right after the initial load, so the pool is on the timer from the moment the server starts. Refresh frequency is unchanged: the pool still refreshes only when `needsRefresh` says its data is due (hourly with `EPG_REFRESH_MS`). Per-user token addons are unchanged and still join the timer on their first catalog request. Tested in the running container by building the pool through `createPoolAddon` with every refresh stubbed, so no providers were contacted. The pool is on the timer straight after startup with no catalog request, a fresh pool is skipped, and a stale one is refreshed. The same test fails on current main.
namillis deleted branch fix/pool-refresh-on-start 2026-10-09 20:01:06 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
namillis/M3U-XCAPI-EPG-IPTV-Stremio!4
No description provided.