Check option before connecting to Redis

This commit is contained in:
Pig Fang 2019-03-20 11:05:41 +08:00
parent d27dc54377
commit 40ea4c0911

View File

@ -47,7 +47,7 @@ class AppServiceProvider extends ServiceProvider
}
try {
if (Redis::ping()) {
if (option('enable_redis') && Redis::ping()) {
config(['cache.default' => 'redis']);
config(['session.driver' => 'redis']);
}