Refresh recently used addons in the background #2

Merged
namillis merged 1 commit from fix/background-refresh into main 2026-10-09 19:52:56 +00:00
Owner

Data only refreshed when someone opened a catalog, and the catalog was served from whatever was cached before the refresh finished. After two quiet days (last refresh Oct 7 1:33 PM), the first Live Now on Oct 9 was built from 2-day-old guides and showed 2 events. It showed 100 once the refresh finished a few minutes later.

Any addon that serves a catalog is now added to a set. Every 5 minutes, addons in that set refresh if their data is due (the same needsRefresh check as before, so still hourly with EPG_REFRESH_MS). The tick also starts the ESPN scoreboard refresh when it's stale. An addon that hasn't been opened in 7 days drops out of the set and goes back to refreshing only when it's opened, so old configs don't keep hitting providers.

Tested in the running container with stand-in addons and the real pool loaded from Redis, without contacting providers: a stale addon is refreshed, a fresh one and one idle for over 7 days are not, an idle one rejoins when opened, and the pool refreshes only once its data is over an hour old.

Data only refreshed when someone opened a catalog, and the catalog was served from whatever was cached before the refresh finished. After two quiet days (last refresh Oct 7 1:33 PM), the first Live Now on Oct 9 was built from 2-day-old guides and showed 2 events. It showed 100 once the refresh finished a few minutes later. Any addon that serves a catalog is now added to a set. Every 5 minutes, addons in that set refresh if their data is due (the same `needsRefresh` check as before, so still hourly with `EPG_REFRESH_MS`). The tick also starts the ESPN scoreboard refresh when it's stale. An addon that hasn't been opened in 7 days drops out of the set and goes back to refreshing only when it's opened, so old configs don't keep hitting providers. Tested in the running container with stand-in addons and the real pool loaded from Redis, without contacting providers: a stale addon is refreshed, a fresh one and one idle for over 7 days are not, an idle one rejoins when opened, and the pool refreshes only once its data is over an hour old.
namillis deleted branch fix/background-refresh 2026-10-09 19:52:59 +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!2
No description provided.