diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2017-05-16 09:52:05 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2017-05-16 09:52:05 +0200 |
commit | 0e66c2a38aa86df2b6a1273b0cf4ad95485ce6e7 (patch) | |
tree | 26b23ec8ad3e8023add2ded120d254713ec79821 /lib/private | |
parent | fe5a4dd4995fcf6fdb3546dab103a5eb84d28f72 (diff) | |
download | nextcloud-server-0e66c2a38aa86df2b6a1273b0cf4ad95485ce6e7.tar.gz nextcloud-server-0e66c2a38aa86df2b6a1273b0cf4ad95485ce6e7.zip |
Do not scan for keys just get all the keys (with prefix)
Apparently scan leads to some issues sometimes on cluster. So just use
the get function to fetch the keys.
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/Memcache/Redis.php | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/private/Memcache/Redis.php b/lib/private/Memcache/Redis.php index a154d08deca..dd7e929a828 100644 --- a/lib/private/Memcache/Redis.php +++ b/lib/private/Memcache/Redis.php @@ -79,12 +79,10 @@ class Redis extends Cache implements IMemcacheTTL { public function clear($prefix = '') { $prefix = $this->getNameSpace() . $prefix . '*'; - $it = null; - self::$cache->setOption(\Redis::OPT_SCAN, \Redis::SCAN_RETRY); - while ($keys = self::$cache->scan($it, $prefix)) { - self::$cache->del($keys); - } - return true; + $keys = self::$cache->keys($prefix); + $deleted = self::$cache->del($keys); + + return count($keys) === $deleted; } /** |