Browse Source

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>
pull/4666/head
Roeland Jago Douma 9 years ago
parent
commit
0e66c2a38a
No known key found for this signature in database GPG Key ID: F941078878347C0C
  1. 10
      lib/private/Memcache/Redis.php

10
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;
}
/**

Loading…
Cancel
Save