You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My expectation in writing the above code is that every second, the worker will log to the console since it's polling for new jobs every 500ms, and I'm saying that the job should schedule to run every second.
Instead, this is what I'm getting in console (two logs, every ~15 seconds):
B) After reading this, it seems like an alternative to schedule on an existing job is to schedule NEW jobs every second (physically insert a new document into the jobs collection in MongoDB). I like that approach, but the only way I can figure out how to do this is wrapping my job in Meteor.setInterval, but that feels sloppy. Surely there's a better way?
The text was updated successfully, but these errors were encountered:
That defaults to 15s and is the reason in the OP that you were only seeing jobs run at that rate.
The final thing account for is that when using repeat, the next repeat of a job will only run after the previous run is done. Repeating jobs will never overlap.
I don't understand the usage of
schedule
withinrepeat
. Consider the following code:job
worker
My expectation in writing the above code is that every second, the worker will log to the console since it's polling for new jobs every 500ms, and I'm saying that the job should schedule to run every second.
Instead, this is what I'm getting in console (two logs, every ~15 seconds):
A) I'm so confused on the above.
B) After reading this, it seems like an alternative to
schedule
on an existing job is to schedule NEW jobs every second (physically insert a new document into the jobs collection in MongoDB). I like that approach, but the only way I can figure out how to do this is wrapping my job inMeteor.setInterval
, but that feels sloppy. Surely there's a better way?The text was updated successfully, but these errors were encountered: