P3.3: Apply execution mode + overlap policy in dispatch

Rework RunDue/startRunLocked/executeRun so the ExecutionMode and
OverlapPolicy config knobs take effect:

- startRunLocked advances NextDue to the next occurrence instead of
  zeroing it, keeping the schedule marching during an in-flight run.
- RunDue scans all due jobs: parallel starts every due, non-running job;
  sequential defers a due job while any other job runs. When a job comes
  due again mid-run, skip drops it and queue marks it Pending; either way
  NextDue is advanced past the fired occurrence.
- executeRun re-runs a Pending job once the current run finishes.
- RunNow gains a sequential-mode guard refusing a manual run while
  another job is running.
- Add anyRunningLocked and advanceNextDueLocked helpers.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
mixeme
2026-06-23 07:54:12 +03:00
parent d381a22034
commit b3e699792a
2 changed files with 92 additions and 23 deletions
+1 -1
View File
@@ -96,7 +96,7 @@ These land together because both edit `domain/job.go` and `storage/store.go`.
### Phase 3 — Task-queue model + settings
- [x] P3.1 — Config/runtime fields + defaults
- [x] P3.2 — Split dispatch into `app/run.go`
- [ ] P3.3 — Rework `RunDue`/`executeRun` for mode + overlap policy
- [x] P3.3 — Rework `RunDue`/`executeRun` for mode + overlap policy
- [ ] P3.4 — Settings Queue selects
- [ ] P3.5 — Queue tests