We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 19a85a9 commit ab6109bCopy full SHA for ab6109b
1 file changed
lib/private/Memcache/Redis.php
@@ -39,17 +39,19 @@ class Redis extends Cache implements IMemcacheTTL {
39
40
private const MAX_TTL = 30 * 24 * 60 * 60; // 1 month
41
42
- private \Redis|\RedisCluster $cache;
+ private \Redis|\RedisCluster|null $cache = null;
43
44
public function __construct($prefix = '', string $logFile = '') {
45
parent::__construct($prefix);
46
- $this->cache = \OCP\Server::get(RedisFactory::class)->getInstance();
47
}
48
49
/**
50
* @throws \Exception
51
*/
52
public function getCache(): \Redis|\RedisCluster {
+ if ($this->cache === null) {
53
+ $this->cache = \OCP\Server::get(RedisFactory::class)->getInstance();
54
+ }
55
return $this->cache;
56
57
0 commit comments