The list rebuilds itself on a schedule (#776) - #906
Merged
Merged
Conversation
LIST_REBUILD_SCHEDULE: daily 04:00 / weekly sun 04:00 / monthly 1 03:30 / every 12h, off by default; anything else is refused in coerce() with the four written out. A worker started at boot and by every rehash (guarded once in runtime.py) waits a minute, then runs exactly what !update runs when due: a time-of-day schedule when the last rebuild is older than the last slot, every Nh from the last rebuild of any kind. The last attempt is kept so a failing rebuild waits for the next slot instead of restarting every minute; a running one is not doubled; no channel announcement. Shown in an [INFO] line, the console's status and the Tools page. A new List rebuild settings category (Your list was at the 16 allowed), help in three languages, sample regenerated, FUTURE.md. 25 tests; both changelogs. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AP6LSxkr4n9dMFNSNMogmW
chchatzop
force-pushed
the
feat/774-a-quoted-phrase-is-a-phrase
branch
from
September 23, 2026 07:56
21c3623 to
00e5a4a
Compare
chchatzop
force-pushed
the
feat/776-a-rebuild-schedule
branch
from
September 23, 2026 08:03
82fd000 to
8c65fd5
Compare
Collaborator
Author
Ninja-FSE
changed the base branch from
feat/774-a-quoted-phrase-is-a-phrase
to
main
September 23, 2026 10:21
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.
Fixes #776. Stacked on #905 (on #904, on #903) - merge those first; all four add at the top of the changelog's Unreleased.
What was missing
Asked by the operator. Nothing rebuilt the list on a timer:
!update, the dashboard's Update list and the console'supdateeach run it once, and FUTURE.md's "rebuilt ... on a schedule" meant the operator's own cron - which a novice never sets up, and which ranupdate_list.pyaroundPAUSE_ON_UPDATEand the in-progress guard.What changed
LIST_REBUILD_SCHEDULE, off by default, one of four shapes:daily 04:00,weekly sun 04:00(full day names too),monthly 1 03:30(a day the month lacks means its last day),every 12h(every 12 hourstoo).settings_file.parse_rebuild_schedule(); anything else is refused incoerce()- the one door every value comes through - with the four written out, so a bad value never reaches the worker.commands.ensure_rebuild_schedule_worker(), fromoserve.startup()and from every rehash, guarded once inruntime.py- the automatic refresh's own pattern, so setting it on the dashboard starts it live and a rehash never starts a second. It waits a minute (a bot just started connects first), thenscheduled_rebuild_tick(), which runs exactlyhandle_list_update_request(..., authorised=True):PAUSE_ON_UPDATE, the one-scan gate and the atomic publish all apply.every Nh: N hours after the last rebuild of any kind. "Last" is the newer of the published list's age andruntime.rebuild_schedule_last_attempt- without the attempt, a rebuild that fails (a folder whose disk is not mounted) would start again every minute; it is reported like a manual failure and tried again at the next slot. A rebuild already running is not doubled. Turning it off idles the loop.every Nhcounts manual rebuilds too, and a scheduled rebuild does not announce in the channel (nobody asked for it) -!updateitself only ever reports to the debug feed.[INFO]Scheduled list rebuild starting line (aLOGline in the mIRC window), aRebuild :line in the console'sstatus, and the Tools page under Update list - next ..., due now, or where to set one (read when the view opens, from the same status payload the Run button polls).LIST_UPDATE_TIMEOUT/LIST_UPDATE_STALL_SECONDSbeside it - "Your list" was at the sixteen the grouping test allows. A new category id, not a renamed one, so nothing attached toyour-listmoves. Help in three languages (kept under the tooltip length), sample regenerated, FUTURE.md names the setting, both changelogs.Test
tests/test_the_list_rebuilds_on_a_schedule.py(25): the parser (the four forms, what people will type, empty = off, every refusal naming the forms,coerce()); when it is due (the issue's restart cases, before the slot, never built, weekly, the month clamp,every Nhfrom any rebuild, the next slot); the tick against a real list file whose age is set (runs what!updateruns and says so, not due, not doubled, a failed rebuild not restarted every minute, retried at the next slot, off); the worker (started once and only with a schedule, waits before its first check, boot and rehash wiring); and the three places it shows. Mutation: dropping the attempt record fails the every-minute test; dropping the in-progress guard fails the doubling test.Verified
Full suite on the stacked branch: 6470 OK (19 skipped).
🤖 Generated with Claude Code
https://claude.ai/code/session_01AP6LSxkr4n9dMFNSNMogmW