I want to clean up a table daily using schedule at midnight, I don't want scheduler to poll too often to waste unnecessary resource. how should I do it?
1) give heartbeat a large number in scheduler = Scheduler(db_sch, heartbeat=7200)?
2) if len(db_sch().select(db_sch.scheduler_task.ALL)) == 0:
scheduler.queue_task(clear_curr_exch_cache, period=86400, repeats=0)
3) create a cron job in linux to start the scheduler (python web2py.py -K myapp -p 8002), another cron job to kill the process after a fixed period of time
4) create a cron job to start the scheduler, call scheduler.terminate() after db.commit() before return in the task action
5) combination of above
Another question: how to i associate tasks to a specific group? I seem to miss this in the doc
Thank you!