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

Invalid cron (zero day of month) results in unpredictable behaviour #10

Closed
hlascelles opened this issue Oct 19, 2018 · 2 comments
Closed
Assignees

Comments

@hlascelles
Copy link
Contributor

Trying to create an invalid cron with a 0th day of month "works".

Fugit::Cron.parse('0 2 1 0 *')                                                                                                                                                                       
=> #<Fugit::Cron:0x00007f90279df648 @cron_s=nil, @hours=[2], @minutes=[0], @monthdays=[1], @months=[0], @original="0 2 1 0 *", @seconds=[0], @timezone=nil, @weekdays=nil, @zone=nil>

The resulting object is unusable (especially for next_time), but there was no error, and it did not return nil.

Should(n't) it do so?

@jmettraux jmettraux self-assigned this Oct 19, 2018
jmettraux added a commit that referenced this issue Oct 20, 2018
jmettraux added a commit that referenced this issue Oct 20, 2018
@jmettraux
Copy link
Member

Hello.

I prevented that for day of month and also for months themselves (month zero was ok).

Thanks a lot.

Please tell me if you spot other impossibilities and I'll do my best to prevent them.

Please tell me as well if you need a release for that.

@hlascelles
Copy link
Contributor Author

Fast work, terrific. No release needed for us at the moment, it's good to know the check will be in the next version. Thanks.

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