Don't use settings caching in cli
This commit is contained in:
@@ -35,9 +35,10 @@ class ConfigServiceProvider extends ServiceProvider
|
|||||||
public function boot()
|
public function boot()
|
||||||
{
|
{
|
||||||
$env = $this->app->environment();
|
$env = $this->app->environment();
|
||||||
|
$cli = $this->app->runningInConsole();
|
||||||
$repo = $this->app->make(Repository::class);
|
$repo = $this->app->make(Repository::class);
|
||||||
$cache = $this->app->make(Cache::class);
|
$cache = $this->app->make(Cache::class);
|
||||||
$loaded = $cache->load($env);
|
$loaded = $cli ? false : $cache->load($env);
|
||||||
|
|
||||||
$this->app->terminating(function () use ($repo, $cache) {
|
$this->app->terminating(function () use ($repo, $cache) {
|
||||||
if ($repo->stale()) {
|
if ($repo->stale()) {
|
||||||
@@ -46,7 +47,7 @@ class ConfigServiceProvider extends ServiceProvider
|
|||||||
});
|
});
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if ($loaded === false) {
|
if ($cli === false && $loaded === false) {
|
||||||
$loaded = $repo->all();
|
$loaded = $repo->all();
|
||||||
$cache->store($env, $loaded);
|
$cache->store($env, $loaded);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user