invite pager get list only in count > 0

This commit is contained in:
xiaomlove
2022-04-22 01:00:59 +08:00
parent 287c568e79
commit 686ec2754c
4 changed files with 21 additions and 15 deletions

View File

@@ -19,10 +19,15 @@ class class_cache_redis {
public $redis;
function __construct() {
$this->connect(); // Connect to Redis
$connectResult = $this->connect(); // Connect to Redis
if ($connectResult) {
$this->isEnabled = true;
} else {
$this->isEnabled = false;
}
}
private function connect()
private function connect(): bool
{
$config = nexus_config('nexus.redis');
$redis = new Redis();
@@ -47,6 +52,7 @@ class class_cache_redis {
} else {
throw new \RuntimeException("Redis connect fail.");
}
return true;
}
function getIsEnabled() {