Skip to content

Commit b664a14

Browse files
committed
RedisCluster does not support getKeys
1 parent 60c824e commit b664a14

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/Cache/Engine/RedisClusterEngine.php

+19
Original file line numberDiff line numberDiff line change
@@ -89,4 +89,23 @@ protected function _connect()
8989

9090
return true;
9191
}
92+
93+
/**
94+
* {@inheritdoc}
95+
*/
96+
public function clear($check)
97+
{
98+
if ($check) {
99+
return true;
100+
}
101+
102+
$keys = $this->_Redis->keys($this->_config['prefix'] . '*');
103+
$result = [];
104+
105+
foreach ($keys as $key) {
106+
$result[] = $this->_Redis->delete($key) > 0;
107+
}
108+
109+
return !in_array(false, $result);
110+
}
92111
}

0 commit comments

Comments
 (0)