Skip to content
Permalink
Browse files

add schedule cache method

  • Loading branch information...
taylorotwell committed May 8, 2019
1 parent 6a70dcf commit 6587e78383c4ecc8d7f3791f54cf6f536a1fc089
Showing with 12 additions and 1 deletion.
  1. +12 −1 src/Illuminate/Foundation/Console/Kernel.php
@@ -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']?

}
/**
* Run the console application.
*

0 comments on commit 6587e78

Please sign in to comment.
You can’t perform that action at this time.