Merge pull request #1976 from CachetHQ/cli

Don't use settings caching in cli
This commit is contained in:
James Brooks
2016-07-15 07:48:26 +01:00
committed by GitHub

View File

@@ -35,9 +35,10 @@ class ConfigServiceProvider extends ServiceProvider
public function boot()
{
$env = $this->app->environment();
$cli = $this->app->runningInConsole();
$repo = $this->app->make(Repository::class);
$cache = $this->app->make(Cache::class);
$loaded = $cache->load($env);
$loaded = $cli ? false : $cache->load($env);
$this->app->terminating(function () use ($repo, $cache) {
if ($repo->stale()) {
@@ -46,7 +47,7 @@ class ConfigServiceProvider extends ServiceProvider
});
try {
if ($loaded === false) {
if ($cli === false && $loaded === false) {
$loaded = $repo->all();
$cache->store($env, $loaded);
}