fix check redis version

This commit is contained in:
xiaomlove
2022-07-18 22:53:56 +08:00
parent e5d996cb75
commit 2912c89202
3 changed files with 15 additions and 8 deletions
+5 -2
View File
@@ -371,13 +371,16 @@ class NexusDB
}
}
/**
* @return mixed|\Redis|null
*/
public static function redis()
{
if (IN_NEXUS) {
global $Cache;
$Cache->getRedis();
return $Cache->getRedis();
} else {
Redis::connection()->client();
return Redis::connection()->client();
}
}
+1 -2
View File
@@ -665,8 +665,7 @@ class Install
public function getRedisVersionInfo(): array
{
global $Cache;
$redis = $Cache->getRedis();
$redis = NexusDB::redis();
$result = $redis->info();
$version = $result['redis_version'];
$match = version_compare($version, '2.0.0', '>=');