Platform 05 · Study guide
Register recurring tasks in app/schedule.py and run due work from cron or a supervisor.
tpy new scaffolds app/schedule.py. Edit register():
# app/schedule.py
def register(schedule):
schedule.command("cache:clear").daily()
schedule.call(lambda: print("heartbeat")).every_minute()
$ tpy schedule list $ tpy schedule run
app.schedule.register.tpy schedule run executes only tasks that are due now.# cron example — every minute
* * * * * cd /var/www/myapp && tpy schedule run
Combine with queue workers: schedule can enqueue Jobs instead of doing heavy work inline.