wildhart / meteor.jobs

A simple job scheduler for Meteor.js
MIT License
18 stars 9 forks source link

Jobs are blocked when one is executing #23

Closed sabativi closed 1 year ago

sabativi commented 1 year ago

I moved from msavin to this package yesterday :

I have a job with the same name but different arguments, one failed this night and prevent the other from running.

I have the singular: false option, what should I do to prevent this ?

Screenshot 2023-05-16 at 09 16 02
chrismorison-wt commented 1 year ago

@sabativi the job is still in "executing" status, so as far as this package concerned the job has not failed and so other jobs of that type will not get executed. As per the docs:

Each job must be resolved with success, failure, reschedule, and/or remove. See Repeating Jobs and Async Jobs/Promises

Other jobs of the same type will still run when scheduled while asynchronous jobs are executing, unless the running job was configured with awaitSync: true, in which case the pending job will wait until the previous job of that name has completed.

Are you using the awaitSync: true option? Are you resolving failed jobs with this.failure()?

Can you share the outline of the job code (including error handling), and also the code where the job is scheduled?

sabativi commented 1 year ago

Thanks @chrismorison-wt, no I am not using awaitAsync, I did not resolve failed jobs with this.failure I had it

wildhart commented 1 year ago

@sabativi it looks like you didn't finish that comment.... But you need to resolved failed jobs with this.failure(). If that doesn't help, please share the skeleton of your job code, and your job schedulding code.

Please report back if you need more help, or close this issue if that fixes it for you...