Skip to content

Add sort option for schedule:list#45198

Merged
taylorotwell merged 5 commits intolaravel:9.xfrom
moshe-autoleadstar:patch-3
Dec 7, 2022
Merged

Add sort option for schedule:list#45198
taylorotwell merged 5 commits intolaravel:9.xfrom
moshe-autoleadstar:patch-3

Conversation

@moshe-autoleadstar
Copy link
Copy Markdown
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.

2 participants