Autobot::Cron::Service
Service for managing and executing scheduled jobs.
Jobs are persisted as JSON and executed via a fiber-based timer loop.
Constants
EXEC_TIMEOUT = 30.seconds
MAX_STORED_OUTPUT_BYTES = 32768
Cap stored exec output so it can be safely re-exported as PREV_OUTPUT on the next run without tripping E2BIG (argument list too long).
OUTPUT_TRUNCATION_NOTICE = "\n...[Output truncated due to size limit]"
RELOAD_CHECK_INTERVAL = 60.seconds
Constructors
Instance methods
add_job(name : String, schedule : CronSchedule, message : String = "", deliver : Bool = false, channel : String | Nil = nil, to : String | Nil = nil, delete_after_run : Bool = false, owner : String | Nil = nil, kind : PayloadKind = PayloadKind::AgentTurn, command : String | Nil = nil) : CronJob
Add a new scheduled job.
Compute next run for a job, using last_run for interval jobs or expression for cron jobs.
Enable or disable a job. If owner is provided, only modifies job if it matches the owner.
Find a single job by ID, optionally enforcing owner access.
List all jobs (optionally including disabled ones). If owner is provided, only returns jobs owned by that owner.
Remove a job by ID. If owner is provided, only removes job if it matches the owner.