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

No longer possible to see name/description for scheduled closure in schedule:list #41852

Closed
ehamrin opened this issue Apr 6, 2022 · 4 comments

Comments

@ehamrin
Copy link
Contributor

ehamrin commented Apr 6, 2022

  • Laravel Version: v9.7.0
  • PHP Version: 8.0.17
  • Database Driver & Version: Not applicable

Description:

Adding a description/name to CallbackEvent is ignored on the schedule:list command, the closure location is printed.

Seems to have broken by #41535

Steps To Reproduce:

Add the following in app/Console/Kernel.php

$schedule
	->call(function() {
		//Do stuff here
	})
	->name('My pretty description');

The following is printed when running php artisan schedule:list

* * * * *  Closure at: app\Console\Kernel.php:32 ................................................... Next Due: 34 seconds from now

Expected output is

* * * * *  My pretty description ................................................... Next Due: 34 seconds from now
@driesvints
Copy link
Member

Ping @xiCO2k

@xiCO2k
Copy link
Contributor

xiCO2k commented Apr 6, 2022

the pretty description will be visible if you run with php artisan schedule:list -v.

I think is way more useful to have the location for the closure, instead of the description.

@ehamrin
Copy link
Contributor Author

ehamrin commented Apr 6, 2022

Glad to see it's still available with -v.

It should be reversed though, I'm setting the name explictly to differentiate the callbacks. Having up towards 100 scheduled commands with a closure location tells me nothing of what they do - the name does. And it gets bloated with multiple lines using verbose.

The location is great for debugging purposes, and should be visible with the verbose flag and the name/description should be the default output.

@driesvints
Copy link
Member

Seems this was intentional. You can always attempt a pr to change Taylor's mind. Thanks all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants