Skip to content

Feat/cron config polling - #7

Merged
rigidlab merged 3 commits into
mainfrom
feat/cron-config-polling
Aug 26, 2026
Merged

rigidlab merged 3 commits into
mainfrom
feat/cron-config-polling

Conversation

@rigidlab

Copy link
Copy Markdown
Owner

No description provided.

rigidlab and others added 3 commits August 25, 2026 21:53
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
@rigidlab
rigidlab merged commit 13532ce into main Aug 26, 2026
4 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