Repository navigation
Store the runner-status cache only when a poll changes it - #69
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The runner-status Durable Object rewrote its whole cache on every 45-second poll, even when GitHub reported nothing new, because each poll renews
checkedAtand 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.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) andbun run typecheckpass.