Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cron reached maximum iterations #394

Closed
13pass opened this issue Dec 9, 2018 · 2 comments
Closed

cron reached maximum iterations #394

13pass opened this issue Dec 9, 2018 · 2 comments

Comments

@13pass
Copy link

13pass commented Dec 9, 2018

Time Zone: "" - Cron String: 0 0 6 29 11 6 - UTC offset: +01:00 - current Date: Sun Dec 09 2018 08:41:45 GMT+0100
using cron@1.5.1

The error is triggered by calling cron.nextDates(5).

      at CronTime.sendAt (node_modules/cron/lib/cron.js:158:18)
      at CronJob.nextDates (node_modules/cron/lib/cron.js:553:24)
      at nextDates (test/next.cronJobs.test.js:51:20)
      at Object.showPlanning (test/next.cronJobs.test.js:71:7)```
@ncb000gt
Copy link
Member

ncb000gt commented Dec 9, 2018

Dupe of GH-393, closing here, responding on other ticket. Thanks!

@ncb000gt ncb000gt closed this as completed Dec 9, 2018
ncb000gt added a commit that referenced this issue Dec 9, 2018
We had a hard limit on the number of iterations a for loop would
execution when attempting to find the next date of execution. This was
arbitrary, but necessary to deter from an infinite loop that would occur
in a few cases. However, it seems better to let the execution happen up
to an arbitrary time length instead. This allows execution of larger
ranges happen, but still should protect against the infinite loop
scenario. This _may_ cause an issue if the event loop locks up, but if
that happens then the module will be hosed anyway, so don't do that. :)

Signed-off-by: Nick Campbell <nicholas.j.campbell@gmail.com>
@13pass
Copy link
Author

13pass commented Dec 11, 2018

Thanks @ncb000gt, it fixes much of the issues but now I sometimes reach the 5000 ms timeout when doing a lot of concurrent actions while using nextDate.

I guess it would be nice to have the possibility to set the timeout value as a parameter of nextDates.

Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants