Bobochka
1/6/2016 - 9:56 PM

Get redis keys

Get redis keys

res = []
cursor = 0
loop do
  cursor, keys = GTRedis.scan(cursor, match: "*drivers*", count: 1000)
  p cursor
  p keys
  p res.size
  # keys.each { |key| p GTRedis.hgetall(key); }
  res << keys if keys.size > 0
  break if cursor.to_i == 0
  sleep 0.2
end

res.flatten!; true
res.size