public function flush($type, $id = null)
{
if ($this->_useRedis) {
if ($id !== null) {
$count = $this->redis->hGet($this->_prefix . $type, $id);
if ($count !== '') {
$this->_save($type, $id, $count);
}
} else {
$it = null;
while ($hashes = $this->redis->hScan($this->_prefix . $type, $it, '', 32)) {
foreach ($hashes as $hash => $count) {
$this->_save($type, $hash, $count);
}
}
}
}
}