Repository navigation
Perf viewer clean-up: Kira calls the site's /api/perf/sweep every 5 minutes - #159
Merged
Merged
Conversation
…inutes Only when PERF_SWEEP_TOKEN is set (the same value as the site's). The viewer's Share uploads expire after an hour unshared, or after PERF_SHARED_DAYS; the sweep frees their bytes in the bucket. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
It took the first open vote, but /elect and /vote in the tests above start on the real clock, so which of them was still open depended on the day: since 2026-11-12 it was an election with no ballots, which never lands in closed, and CI failed on main's tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ludovic111
added a commit
that referenced
this pull request
Nov 12, 2026
…160) bot.js maps every feature's commands; perfsweep (#159) had none, so commands.map hit undefined.toJSON() on clientReady and Kira crashed since 16:27Z. A test now checks every feature bot.js loads exports a commands array. Co-authored-by: Horizon agent <agent@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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 perf viewer on playhorizon.dev (horizon-site#93) keeps Share uploads in an S3 bucket: unshared ones expire after an hour, shared ones after
PERF_SHARED_DAYS. The site frees their bytes only whenPOST /api/perf/sweepis called withAuthorization: Bearer $PERF_SWEEP_TOKEN, and the site has no timer of its own.src/features/perfsweep.jsmakes that call every 5 minutes, only whenPERF_SWEEP_TOKENis set on Kira (the same value as the site's). Without the variable nothing runs, so this is inert until Share's bucket is configured.Also fixes a test that started failing on its own today:
elections.test.js"the timer closes votes at 24 hours…" took the first open vote, but/electand/votein earlier tests start on the real clock, so from 2026-11-12 it picked an election with no ballots. It now runs its own vote at the test's fixed time.Tests:
test/perfsweep.test.js(posts with the token, nothing without one, an HTTP error is reported).npm test: 631 pass, 0 fail.🤖 Generated with Claude Code