Skip to content

fix(core): keep overview & queue list live (don't pin cache on read)#41

Open
omar-zeineddine wants to merge 1 commit into
pontusab:mainfrom
omar-zeineddine:fix/overview-stale-cache
Open

fix(core): keep overview & queue list live (don't pin cache on read)#41
omar-zeineddine wants to merge 1 commit into
pontusab:mainfrom
omar-zeineddine:fix/overview-stale-cache

Conversation

@omar-zeineddine

Copy link
Copy Markdown

Problem

Fixes #25 — the Overview page never updates live: it stays static even after a hard refresh, while the Runs page updates fine.

Root cause

QueueManager's LRU cache is created with updateAgeOnGet: true, which resets an entry's TTL on every read. The dashboard polls /api/overview and the queue list every 5s (useOverviewrefetchInterval: 5000), while overview/queues have a 2-minute TTL. So those entries are re-read long before they expire, their age keeps resetting, and they never expire — the first snapshot is served indefinitely. Because it's a server-side cache, a browser hard refresh doesn't help (matches the report).

The Runs page is unaffected because getAllRuns/getLatestRuns aren't cached. metrics (5m TTL, polled every 30s) and quick-counts had the same latent issue.

A related symptom: pauseQueue/resumeQueue don't invalidate any cache (unlike retryJob/removeJob/promoteJob), so pausing/resuming a queue isn't reflected in the overview or queue list.

Fix

  • updateAgeOnGet: false — entries expire on their TTL instead of being pinned by reads.
  • overview/queues TTL 2m → 5s, matching the frontend's 5s poll cadence. Job counts are already gated by the existing 5s countCache, so this doesn't add meaningful Redis load.
  • Invalidate queues/overview after pauseQueue/resumeQueue so queue control reflects immediately.
  • invalidateJobCache now also drops the derived queues entry (the overview is computed from it).

Verification

  • bunx tsc --noEmit in packages/core — passes.
  • biome check on the changed file — clean.
  • Manually: pausing a queue now reflects in the overview/queue list within a poll cycle (and immediately after the action) instead of staying stale.

@vercel

vercel Bot commented Jun 22, 2026

Copy link
Copy Markdown

@omar-zeineddine is attempting to deploy a commit to the Pontus Abrahamsson's projects Team on Vercel.

A member of the Team first needs to authorize it.

@omar-zeineddine omar-zeineddine force-pushed the fix/overview-stale-cache branch from 6b2fb54 to 602b11a Compare June 24, 2026 17:38
The QueueManager LRU cache used `updateAgeOnGet: true`, which resets an
entry's TTL on every read. The dashboard polls the overview and queue
list continuously, so those entries were re-read before their TTL
elapsed and never expired — the overview showed stale data indefinitely,
even across hard refreshes (pontusab#25).

- Disable `updateAgeOnGet` so entries expire on their TTL.
- Shorten `overview`/`queues` TTL to 5s to match the frontend's 5s poll
  cadence (counts are already gated by the 5s countCache).
- Invalidate `queues`/`overview` on pause/resume so queue control
  reflects immediately, consistent with retry/remove/promote.
- Also drop the derived `queues` entry in invalidateJobCache (overview
  is computed from it).

Fixes pontusab#25
@omar-zeineddine omar-zeineddine force-pushed the fix/overview-stale-cache branch from 602b11a to 9d6b7f3 Compare June 24, 2026 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Overview does not update live

2 participants