Skip to main content

Module schedule_claim

Module schedule_claim 

Source
Expand description

Schedule claim/release — prevents double execution between CLI cron and Commander.

The executor field in Schedule tracks who is responsible for ticking. PID file at ~/.mur/commander/commander.pid indicates Commander is alive.

Functions§

auto_detect_executor
Determine the appropriate executor for a new schedule. If Commander is running, use Commander. Otherwise, use SystemCron.
claim_all_for_commander
Claim all schedules for Commander — sets executor to Commander. Returns the list of schedules that were claimed (had executor != Commander).
commander_pid_path
Default Commander PID file path.
is_commander_running
Check if Commander daemon is currently running.
is_commander_running_at
Check if Commander is running given a specific PID file path.
load_schedules
Load schedules from the default path.
release_all_from_commander
Release all schedules from Commander — sets executor back to SystemCron. Returns the list of schedules that were released.
save_schedules
Save schedules to the default path.
schedules_path
Default schedules.yaml path.