Skip to content

Commit

Permalink
Diagnose command, allow checking of redis via socket connection (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
joejenniges authored and leonjza committed May 31, 2018
1 parent c0ab432 commit efd4124
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions src/Commands/Seat/Admin/Diagnose.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,10 +217,19 @@ public function check_redis()

try {

$redis = new Client([
'host' => config('database.redis.default.host'),
'port' => config('database.redis.default.port'),
]);
if (config('database.redis.default.path') != null && config('database.redis.default.scheme') != null) {
$redis = new Client([
'scheme' => config('database.redis.default.scheme'),
'path' => config('database.redis.default.path'),
]);
}
else {
$redis = new Client([
'host' => config('database.redis.default.host'),
'port' => config('database.redis.default.port'),
]);
}

$this->info('Connected to Redis');

$redis->set($test_key, Carbon::now());
Expand Down

0 comments on commit efd4124

Please sign in to comment.