Skip to content

Commit

Permalink
add schedule cache method
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed May 8, 2019
1 parent 6a70dcf commit 6587e78
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/Illuminate/Foundation/Console/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,25 @@ public function __construct(Application $app, Dispatcher $events)
protected function defineConsoleSchedule()
{
$this->app->singleton(Schedule::class, function ($app) {
return new Schedule($this->scheduleTimezone());
return (new Schedule($this->scheduleTimezone()))
->useCache($this->scheduleCache());
});

$schedule = $this->app->make(Schedule::class);

$this->schedule($schedule);
}

/**
* Get the name of the cache store that should manage scheduling mutexes.
*
* @return string
*/
protected function scheduleCache()
{
return $_ENV['SCHEDULE_CACHE_DRIVER'] ?? null;

This comment has been minimized.

Copy link
@martinbean

martinbean May 15, 2019

Contributor

Would it not be better to access a configuration value via the container here, i.e. $this->app['config']['cache.schedule_driver']?

This comment has been minimized.

Copy link
@stefandjokic

stefandjokic Mar 31, 2020

Why was this not mentioned anywhere in upgrade docs?

}

/**
* Run the console application.
*
Expand Down

0 comments on commit 6587e78

Please sign in to comment.