meteor-job-collection icon indicating copy to clipboard operation
meteor-job-collection copied to clipboard

workTimeout / next repeat

Open jensvrai opened this issue 8 years ago • 1 comments

I have a questions about job.fail() and repeats. We currently have some long running jobs, which wait for feedback from external services but sometimes it never comes. So we used the workTimeout option when calling processJobs. But we also defined a repeat schedule for the job, so it runs everyday. Is there an options that when a job fails, it is rescheduled based on the repeat schedule? Like it does when job.done is called?

jensvrai avatar Dec 01 '16 10:12 jensvrai

Probably the easiest way to do this is to also specify a retry() on the job that matches the desired repeat frequency. Retry is not as flexible as repeat, but for the case you describe it should suffice by simply specifying each retry to be 1 day minus your workTimeout value. If you specify infinite retries, it will retry once per day and when it finally succeeds, the next repeat will automatically occur as scheduled.

vsivsi avatar Dec 01 '16 22:12 vsivsi