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