Skip to content

Refuse a task start when its running check fails - #300

Merged
athNdev merged 10 commits into
mainfrom
feat/task-claim-ownership
Nov 4, 2026
Merged

athNdev merged 10 commits into
mainfrom
feat/task-claim-ownership

Conversation

@athNdev

@athNdev athNdev commented Oct 28, 2026

Copy link
Copy Markdown
Owner

Summary

  • A task is no longer claimed when the running-execution check fails. A scheduled run stays due, a manual trigger returns the check error, and an unknown check is treated as running.
  • A missed cron slot runs once. The next stored time is the next future slot in the controller's local time, not a replay of the gap.

Test plan

  • go test ./internal/scheduler/ -count=1 -p 1 -run "TestTryClaimTask|TestDueCronRunsOnce|TestTriggerTask|TestHandleServerEvent_Deduplicates"
  • Confirm a closed database refuses the claim and does not mark the task running in memory.
  • Confirm a cron that was due three hours ago records one execution and a future next run, and the following tick does not run it again.

@athNdev
athNdev force-pushed the feat/task-claim-ownership branch from deac1b6 to 3d1f997 Compare November 4, 2026 00:29
athNdev and others added 10 commits November 4, 2026 11:37
…e and wake cannot change that world at the same time.

Co-authored-by: Cursor <[email protected]>
…, and say what to do when one of those jobs is interrupted.

Co-authored-by: Cursor <[email protected]>
…till running, and keep the lock when that command fails.

Co-authored-by: Cursor <[email protected]>
@athNdev
athNdev force-pushed the feat/task-claim-ownership branch from 3d1f997 to 7f174ea Compare November 4, 2026 00:42
@athNdev
athNdev merged commit 85bf80b into main Nov 4, 2026
11 checks passed
@athNdev
athNdev deleted the feat/task-claim-ownership branch November 4, 2026 00:48
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