-
Notifications
You must be signed in to change notification settings - Fork 11k
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
Console Schedule call does not call before() #18851
Comments
Tested this locally and it seems to be isolated to closure based scheduling events: This does not echo "before"
However, this does output "before", as expected:
|
Dug a little more... With a command based scheduling event, by default will run in the foreground, meaning it will call the However, in this case, with a closure based event, I'm thinking it may be intentional that the
It'd be easy enough to add |
Submitted a pull request for 5.5 to fix this issue. |
I agree with what you say. And I reproduced the same with call,command and exec exec as @jhoff wrote above.
Right from functional aspects, but what I wanted to do was to generalize some logging functionality for cronjobs with the before() and after() methods and to make it clean and pretty. |
Thank you for the report, moving the discussion to the opened PR #18861 |
Console Schedule call does not call before() Callbacks :
Steps To Reproduce:
Create a simple call schedule with on callBackfunction and
a before() and after call(). In my example the before method dd('before') the after dd('after).
I chose a minutely interval so you can easily run
php artisan schedule:run
The expected behavior and output should be
The text was updated successfully, but these errors were encountered: