Jobs

1 entry

Markdown

m.every

Run a function on a schedule.

Signature
m.every(seconds, *, name=None)
Example · Where the machine is defined
@m.every(3600)
def check_quotes():
    m.save_setting("checked", int(m.setting("checked", default=0) or 0) + 1)

Every seconds, from 15 to a week. Your Ownbox keeps the clock: the first run is due as soon as the machine starts, and a run that raises is reported while the next one goes ahead. Use it as a decorator. A button on the machine's page runs one of its jobs as if its time had come.

Needs in machine.yaml
Nothing