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

Add checking "is format of expression valid" #282

Open
engor opened this issue Jan 16, 2020 · 3 comments
Open

Add checking "is format of expression valid" #282

engor opened this issue Jan 16, 2020 · 3 comments
Labels
Milestone

Comments

@engor
Copy link

engor commented Jan 16, 2020

Faced out problem when did mistake in weeklyOn() method, just forgot to specify $day param:
->weeklyOn('11:25'). Such call was converted to 0 0 * * 11:25 and it's invalid format.

And as a result all tasks after this didn't work at all! And there were no visible errors, it stop somewhere under the hood of cron (I guess).

Would be very useful to have auto-check of cron expression and trigger error if there is a problem and don't run problematic task.

Thanks. :)

@PabloKowalczyk
Copy link
Collaborator

Hello, all i can do now is to show deprecation notice in v2.1 and throw exception in v3.0 in case someone passes wrong Cron expression. WDYT?

@PabloKowalczyk PabloKowalczyk added this to the v2.2 milestone Feb 2, 2020
@engor
Copy link
Author

engor commented Feb 23, 2020

Exception in v3.0 sounds cool! :) Sorry for long reaction, I missed your answer.

@PabloKowalczyk
Copy link
Collaborator

PabloKowalczyk commented Jun 18, 2020

Actually, I've tested it and proper exception [InvalidArgumentException] Invalid CRON field value 11:25 at position 4 is shown, what version of Crunz do you use?

@PabloKowalczyk PabloKowalczyk modified the milestones: v2.2, v2.3 Jun 18, 2020
@PabloKowalczyk PabloKowalczyk modified the milestones: v2.3, v2.NEXT Mar 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants