openloops.whenthen_job#
Handing the periodic jobs to whenthen: register a job, take over from the launchd agent.
whenthen is the fleet’s scheduler (one clock, run records, whenthen status). Each job
this package used to install as a launchd agent (the digest sync, the reminder tick, the
pile nudge, the board receiver, the board refresh) can instead be a whenthen job; this
module is the one place that knows how. It is used when python -m whenthen --help
works under the interpreter openloops runs in, and never required: without it the
installers behave as before.
A job’s name is its launchd label with the dots turned into dashes
(openloops.remind-tick -> openloops-remind-tick), so the label still names it.
Functions
|
The whenthen job for a launchd label. |
|
An interval as whenthen's |
|
|
Whether whenthen can be run under this interpreter (never a hard dependency). |
|
|
Add the job for |
|
The whenthen job's state for |
|
Remove the whenthen job for |
- openloops.whenthen_job.available()[source]#
Whether whenthen can be run under this interpreter (never a hard dependency).
- Return type:
- openloops.whenthen_job.every_flag(seconds)[source]#
An interval as whenthen’s
--everyvalue.>>> every_flag(900), every_flag(21600), every_flag(60) ('15m', '6h', '1m')
- Return type:
- openloops.whenthen_job.job_name(label)[source]#
The whenthen job for a launchd label.
>>> job_name("openloops.remind-tick") 'openloops-remind-tick'
- Return type:
- openloops.whenthen_job.register(*, label, intent_file, intent_key, params=None, interval, env=None, cwd=None, env_file=None, timeout='30m', delay=None, source, quote='', take_over, restore, dry_run=False, run_once=False)[source]#
Add the job for
labeland stop its launchd agent (take_over).Order: vocabulary entry, dry run,
take_over, add. A failed add callsrestore(the old agent installed again) and raises. Returnsscheduler,job,echo,intervaland, withrun_once,first_run(its status).
- openloops.whenthen_job.remove(label)[source]#
Remove the whenthen job for
labelif there is one. True when one was removed.- Return type: