summaryrefslogtreecommitdiffstats
path: root/lib/private/Memcache
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2017-05-16 09:52:05 +0200
committerRoeland Jago Douma <roeland@famdouma.nl>2017-05-16 09:52:05 +0200
commit0e66c2a38aa86df2b6a1273b0cf4ad95485ce6e7 (patch)
tree26b23ec8ad3e8023add2ded120d254713ec79821 /lib/private/Memcache
parentfe5a4dd4995fcf6fdb3546dab103a5eb84d28f72 (diff)
downloadnextcloud-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/Memcache')
-rw-r--r--lib/private/Memcache/Redis.php10
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;
}
/**