-
Notifications
You must be signed in to change notification settings - Fork 11.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[10.x] Sub-minute Scheduling (#47279)
* Add sub-minute scheduling * formatting * Allow sub-minute events to conditionally run throughout the minute * Fix test failure caused by new mutex cache * Formatting * Pass queue from Mailable to SendQueuedMailable job (#47612) * Pass queue from Mailable to SendQueuedMailable job Fixes issue where the unserialized job has the wrong queue. * Pass connection from Mailable to SendQueuedMailable job * Fix property mismatches in SendQueuedMailable * order --------- Co-authored-by: Taylor Otwell <[email protected]> * Add sub-minute scheduling * formatting * Allow sub-minute events to conditionally run throughout the minute * Fix test failure caused by new mutex cache * Formatting * bail early --------- Co-authored-by: Taylor Otwell <[email protected]> Co-authored-by: Tarvo R <[email protected]>
- Loading branch information
1 parent
a88e2d3
commit 7c707a1
Showing
8 changed files
with
522 additions
and
4 deletions.
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.