-
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
[10.x] Sub-minute Scheduling #47279
Merged
Merged
[10.x] Sub-minute Scheduling #47279
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
524f1e1
Add sub-minute scheduling
jessarcher 887d9af
formatting
taylorotwell 4e4358e
Allow sub-minute events to conditionally run throughout the minute
jessarcher 97b4af6
Fix test failure caused by new mutex cache
jessarcher c8d8b2c
Formatting
jessarcher a88e2d3
Pass queue from Mailable to SendQueuedMailable job (#47612)
Tarpsvo 51a1a39
Add sub-minute scheduling
jessarcher 07964ec
formatting
taylorotwell d5e4755
Allow sub-minute events to conditionally run throughout the minute
jessarcher b314202
Fix test failure caused by new mutex cache
jessarcher bc249c6
Formatting
jessarcher ff00377
Merge branch 'sub-minute-scheduling' of github.com:laravel/framework …
taylorotwell 2760f38
bail early
taylorotwell File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
src/Illuminate/Console/Scheduling/ScheduleInterruptCommand.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<?php | ||
|
||
namespace Illuminate\Console\Scheduling; | ||
|
||
use Illuminate\Console\Command; | ||
use Illuminate\Contracts\Cache\Repository as Cache; | ||
use Illuminate\Support\Facades\Date; | ||
use Symfony\Component\Console\Attribute\AsCommand; | ||
|
||
#[AsCommand(name: 'schedule:interrupt')] | ||
class ScheduleInterruptCommand extends Command | ||
{ | ||
/** | ||
* The console command name. | ||
* | ||
* @var string | ||
*/ | ||
protected $name = 'schedule:interrupt'; | ||
|
||
/** | ||
* The console command description. | ||
* | ||
* @var string | ||
*/ | ||
protected $description = 'Interrupt the current schedule run'; | ||
|
||
/** | ||
* The cache store implementation. | ||
* | ||
* @var \Illuminate\Contracts\Cache\Repository | ||
*/ | ||
protected $cache; | ||
|
||
/** | ||
* Create a new schedule interrupt command. | ||
* | ||
* @param \Illuminate\Contracts\Cache\Repository $cache | ||
* @return void | ||
*/ | ||
public function __construct(Cache $cache) | ||
{ | ||
parent::__construct(); | ||
|
||
$this->cache = $cache; | ||
} | ||
|
||
/** | ||
* Execute the console command. | ||
* | ||
* @return void | ||
*/ | ||
public function handle() | ||
{ | ||
$this->cache->put('illuminate:schedule:interrupt', true, Date::now()->endOfMinute()); | ||
|
||
$this->components->info('Broadcasting schedule interrupt signal.'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this say "60 is not evenly divisible by the seconds [$seconds]" or some other wording.
The current wording implies that seconds needs to be divisible by 60 but that's not what the code does...?