Skip to content
Snippets Groups Projects
Unverified Commit 0e66c2a3 authored by Roeland Jago Douma's avatar Roeland Jago Douma
Browse files

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: default avatarRoeland Jago Douma <roeland@famdouma.nl>
parent fe5a4dd4
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment