Skip to content

Instantly share code, notes, and snippets.

@richardking
Created November 29, 2013 22:18
Show Gist options
  • Select an option

  • Save richardking/7712720 to your computer and use it in GitHub Desktop.

Select an option

Save richardking/7712720 to your computer and use it in GitHub Desktop.
games array script
@old_key = nil
10000.times do
puts "-- #{Time.now} --"
if @old_key
puts "OLD KEY #{@old_key}"
puts "OLD KEY RESULTS: #{REDIS.zrangebyscore(@old_key, 10.hours.ago.to_i, (Time.now+10.days).to_i).count}"
end
key = Score.league_cache_key("NCAAFB", "Football")
game_key = REDIS.get(key)
@old_key = game_key
puts game_key
xx = REDIS.zrangebyscore(game_key, 10.hours.ago.to_i, (Time.now+10.days).to_i).count
if xx == 0
puts "ZERO"
else
puts xx
end
sleep(1)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment