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 sort option for schedule:list #45198

Merged
merged 5 commits into from Dec 7, 2022
Merged

Conversation

moshe-autoleadstar
Copy link
Contributor

@moshe-autoleadstar moshe-autoleadstar commented Dec 6, 2022

Currently, in order to see what schedule task will be run next, one needs to run schedule:list and eyeball the list to find the relevant ones. This PR adds an option to sort the list by the next due date.

Standard Usage:

php artisan schedule:list

  0    *   * * *    php artisan command-one .......... Next Due: 55 minutes from now
  15   *   * * *    php artisan command-three ........ Next Due: 10 minutes from now
  17   *   * * *    php artisan command-two .......... Next Due: 12 minutes from now

Sort by next due:

php artisan schedule:list --next

  15   *   * * *    php artisan command-three ........ Next Due: 10 minutes from now
  17   *   * * *    php artisan command-two .......... Next Due: 12 minutes from now
  0    *   * * *    php artisan command-one .......... Next Due: 55 minutes from now

moshe-autoleadstar and others added 5 commits December 6, 2022 13:06
Currently, in order to see what's schedule will be run, I need to run schedule:list and eyeball the list to find the relevant ones.
This PR adds an option to sort the list by the next due date.

Before:
```
php artisan schedule:list

  0    *   * * *    php artisan command-one .......... Next Due: 55 minutes from now
  15   *   * * *    php artisan command-three ........ Next Due: 10 minutes from now
  17   *   * * *    php artisan command-two .......... Next Due: 12 minutes from now
```

After:
```
php artisan schedule:list

  15   *   * * *    php artisan command-three ........ Next Due: 10 minutes from now
  17   *   * * *    php artisan command-two .......... Next Due: 12 minutes from now
  0    *   * * *    php artisan command-one .......... Next Due: 55 minutes from now
```
@taylorotwell taylorotwell merged commit 28d07f0 into laravel:9.x Dec 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants