-
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
[8.x] Adds "schedule:work" command #34618
Conversation
The scheduler was meant to be used in combination with a daemon that runs it every minute and obviously not manually by hand 😅 |
Yeah, I know 😅 But I'm talking about the cases when you just want to test something & don't want to add the Cron entry to the system for this testing. |
Ah I see. Hmm yeah could be cool actually! Wondering if we can't just add a |
Let's see what others think. I'd rather leave a schedule worker as a separate command to avoid the complexity of |
Don't you need to register the command with the framework? |
Oh, I forgot about that because Laravel automatically detects commands inside the application 😅 |
@taylorotwell I've updated the PR |
I think this feature should be just for local development and not for production. It could behave differently than traditional Unix cron jobs.
If |
This is hot 🔥. Previously, I was running this command to basically achieve the same thing: while true; do php artisan schedule:run; sleep 60; done |
@ottoszika check it out #34736 |
Will this also be coming to Lumen? |
@hivokas can i use this in production?
|
Right now there are 2 options to test the scheduler:
schedule:run
by hand every minute (that's annoying);This new
schedule:work
command emulates the second option by runningschedule:run
command every minute under the hood.When you want to stop the worker, just use
Ctrl
+C
.Inspired by laravel/ideas#2338