i using cakephp. want run scheduled jobs. here's situation:
user set time task on ui (say 1 week). when time over, want execute specific task. meanwhile, user can change time, , task should executed @ updated time.
what best way (and reliable) achieve this?
ps: complexity not issue. task must run after specific time under circumstances.
- set execution date in table in field
- set status (pending) well
- run cron job runs a cakephp shell every x seconds or minutes, whatever need or create shell keeps running time , check records every x seconds in loop.
- the shell process tasks configure execution date lower current date
- set status success or failed depending on outcome
it's how want handle failed tasks , if it's ok if task executes 10secs later configured or 10 minutes. there multiple factors play this: interval of cron job / query against table. have processed in parallel? ok process them after each other? information vague.
Comments
Post a Comment