use Illuminate\Support\Facades\Redis;
$cursor = '0'; // Start with initial cursor
do {
// Scan for keys with current cursor
list($cursor, $keys) = Redis::scan($cursor);
foreach ($keys as $key) {
echo "Key: $key\n";
}
} while ($cursor !== '0'); // Continue scanning until cursor is '0'
1条答案
按热度按时间2vuwiymt1#
在Redis中,集群,如果你有很多键,建议扫描而不是键。但是,你应该正确使用它。试着用这种方式。
参考:Laravel and redis scan