Skip to content

Store the runner-status cache only when a poll changes it - #69

Merged
nicosuave merged 2 commits into
mainfrom
runner-status-skip-unchanged
Nov 15, 2026
Merged

nicosuave merged 2 commits into
mainfrom
runner-status-skip-unchanged

Conversation

@nicosuave

Copy link
Copy Markdown
Member

The runner-status Durable Object rewrote its whole cache on every 45-second poll, even when GitHub reported nothing new, because each poll renews checkedAt and the per-source fetch times. The cache is about 100 KiB on a busy org, and on celld each rewrite becomes an LTX segment. One self-hosted collector produced about 3,500 segments a day, 179k since September.

  • storedContent() serializes the cache with the renewed fetch times removed.
  • poll() skips the storage transaction when that content matches what was last stored, and still stores at least every 10 minutes so a restart restores recent fetch times.
  • The alarm and the in-memory snapshot are unchanged, so viewers still see each poll's checkedAt.

Tests: a collector test that renewed fetch times compare equal while changed runner data and refresh errors do not, and the worker restart test now checks that an unchanged alarm poll leaves the stored cache alone. bun test examples/runner-status (18 pass) and bun run typecheck pass.

Every 45-second poll rewrote the whole cache (about 100 KiB on a busy org)
even when GitHub reported nothing new, because each poll renews its fetch
timestamps. On celld every rewrite becomes an LTX segment, so one idle
collector produced thousands of segments a day.

Compare the cache with those timestamps removed and skip storage when it is
unchanged, still storing at least every 10 minutes so a restart restores
recent fetch times.
Keeps poll() free to run later steps after the store, such as recording
history, instead of returning early when the cache is unchanged.
@nicosuave
nicosuave merged commit f7bc8f1 into main Nov 15, 2026
12 checks passed
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.

1 participant