-
-
Save stevehodgkiss/f8a32b789ce56185b020 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'redis' | |
require 'timeout' | |
redis = Redis.new | |
redis.set('chunky', 'bacon') | |
res_a = nil | |
res_b = nil | |
count = 0 | |
outer_count = 0 | |
loop { | |
begin | |
Timeout.timeout(0.5) { | |
loop { | |
res_a = redis.info | |
puts "got res_a: #{res_a}" unless res_a.is_a? Hash | |
res_b = redis.get "chunky" | |
if !(res_b =~ /bacon/) | |
puts "got: res_b: #{res_b} count: #{count} outer_count: #{outer_count}" | |
exit!(0) | |
else | |
count += 1 | |
p count | |
end | |
} | |
} | |
rescue | |
end | |
outer_count += 1 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment