-
Notifications
You must be signed in to change notification settings - Fork 11.1k
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
Task Scheduling quarterly running on June? #19532
Comments
The CRON expression seems correct to me |
Shouldnt it be 0 0 1 */3 * |
The last place is optional and it represents the year. |
checking the server time, it is set UTC. But in my config/app.php I set America/Bogota. But even with this, the task is triggered one month earlier |
Weird, I don't seem to have an explanation for that, only thing I can think of is if your server date is not correct so it thinks we are in july. |
Taylor just merged my PR with method that shows next time Event will run. There is example for debug. You can try it to see if dates are expected. |
@okmkey45 any updates on this, testing on local machine as well as a Forge server shows that quarterly schedules for the beginning of next month. Must be something with your environment. |
I checked my server configuration time and my laravel application configuration and it seems to be set right. The only thing that I can do for now is that the task triggers on july 1st and I hope it works. |
Ok I'm going to close this issue for now since nobody can replicate, please feel free to ping me if you ever found what was wrong. |
@okmkey45 you said you wanted the task to run on the following months January, April, July, October. I ran the following code and found that I've written the console output as comments for each respective
Perhaps you need to approach the problem with a different solution? Thanks to @decadence for the |
In fact I think this is bug with underlying library https://github.com/mtdowling/cron-expression Proof (click on next link to see all next dates). Only workaround I see is |
@decadence interesting, investigating. |
Created issue on mtdowling/cron-expression |
@decadence looks like this is intended, asked a few random persons to define quarterly and all said 3,6,9,12 .. I don't think this will change in the framework, you can however describe your own expression using the
|
I'm disagree.
Now it runs on 1 March 00:00 which is not end or start of quarter at all and that's completely wrong. |
Hello! I'm the maintainer of the mtdowling/cron-expression library. Upon further inspection (and right now going through cronie source code), the behavior of the The fix for this will also impact Day of Month, which also starts with an index of As a stop-gap, I'd suggest having the code that generates a quartly cron change to |
Opened #19600 using the solution provided by @dragonmantank |
@dragonmantank thanks for reaching out, I understand that for an actual CRON expression 1/3 should run on 1,4,7,10 but I'm saying that changing this now might break some people's apps who rely on the fact that it currently runs on 3,6,9,12. Thanks again :) moving the discussion to #19600 |
@themsaid Agreed. The behavior will not be changing for v1.x, which is the version Laravel currently uses. It will be in the upcoming v2.x branch, which is currently master. |
so, in conclusion I better use
at least for now to solve my problem. Thanks everyone. |
How does it solve your problem if it runs every minute? |
I´m sorry. My bad. I mean, I will use the cron method, not that configuration. |
Description:
I want a task scheduling running every three months (Jan, Apr, Jul, Oct). So looking the documentation and the code, the method "quarterly" seemed to work for me. So I used it like this:
$schedule->command('command-name')->quarterly();
But something weird happened. The task was triggered on Jun 1st. Why? does it affect when I set the kernel.php configuration? My timezone is America/bogota
Steps To Reproduce:
Well, this could be hard. Use the quarterly method on a scheduled task and wait?
The text was updated successfully, but these errors were encountered: