-
|
Hi. I'm trying to figure out an issue in an use case where I have a queue and use a cron based handler. My question is regarding to waitForCompletion option which, as I've understood, will wait for the previous tick and, if in executition by the time when another should be dispatched, this will be skipped - like stated in the docs. But waht I'm facing in reality that my callback isn't fully executed - it's basicly a loop over the queue to process it. In fact, having multiple items in the queue, the effect is like only one existed. If someone could give me any advice about the working of the waitForCompletion option I would be gratefull. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
|
Hi. If I understand correctly, your callback function loops over items in the queue, but when using the Is the behavior the same if you try to run the job with a real date instead (so it runs only once), or have you confirmed this happens only when using the Here's an example: node-cron/examples/run_at_specific_date.js Lines 1 to 11 in ecbe916 |
Beta Was this translation helpful? Give feedback.
I'm sorry for the late replay.
You're completelly right - again. Turns out, I found the problem: since I'm using the package in a React component, I made the mistake of dont isolate my callback. As soon I fixed it (using a ref instead of my state directly), everything worked as expected.
Thank you again for your time and disposition to help - and this package. Cheers!