@@ -22,3 +22,16 @@ def get_addresses_with_users(redis)
addrs
end
+
+module RedisBtcAddresses
+ def self.each_user(redis)
+ # I picked 1000 because it made a relatively trivial case take 15 seconds
+ # instead of forever.
+ # Basically it's "how long does each command take"
+ # The lower it is (default is 10), it will go back and forth to the client a
+ # ton
+ redis.scan_each(match: "jmp_customer_btc_addresses-*", count: 1000) do |key|
+ yield key, redis.smembers(key)
+ end
+ end
+end