Skip to content

Commit

Permalink
Merge pull request #1976 from CachetHQ/cli
Browse files Browse the repository at this point in the history
Don't use settings caching in cli
  • Loading branch information
jbrooksuk authored Jul 15, 2016
2 parents 5879a2c + fd25edb commit d5eb087
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/Foundation/Providers/ConfigServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand All @@ -46,7 +47,7 @@ public function boot()
});

try {
if ($loaded === false) {
if ($cli === false && $loaded === false) {
$loaded = $repo->all();
$cache->store($env, $loaded);
}
Expand Down

0 comments on commit d5eb087

Please sign in to comment.