Repository navigation
Feat/cron config polling - #7
Merged
Merged
Conversation
SPEC.md gains Phase 4s.1, covering why the config files are polled once a minute rather than watched, and stating the two limits this does not remove: the whole-file save still resolves last-writer-wins inside the same minute, and each instance still fires every job into its own tab. USAGE.md says the same in user terms, in the Cron section. Code assisted by Opus 5. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01M8UgLA68nRCYg3qFTyW8ms
Two qtxterm windows are two processes over one cron.json and one presets.json. Each loaded its file once at launch, so a job added in one was invisible to the other until restart, and the next save from the stale window wrote its old list over the new one. New ConfigStore holds the file handling both stores already shared: a stamped reload that stats before it parses, an atomic save so a polling reader never sees a truncated file, and a counted suspend the editors hold while open - they address entries by index, and an exec() dialog still runs the event loop. CronScheduler re-reads on each minute change, before firing. Polled there rather than watched because that tick already runs every second, so it costs a stat and no extra wakeup, and because QFileSystemWatcher stops watching a file that is replaced - which is what the atomic save does. Presets are refreshed as well as jobs, since a job whose Macro has not been re-read fails every firing. Code assisted by Opus 5. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01M8UgLA68nRCYg3qFTyW8ms
The "other instance" is a second store over the same path, which is what two windows are. Covers the pickup itself, that an unchanged file is never reparsed, that half-written JSON and a deleted file change nothing and are retried, that an open editor holds reloads off, and that a reload leaves a running job pointed at its own tab. Code assisted by Opus 5. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01M8UgLA68nRCYg3qFTyW8ms
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.
No description provided.