Advertisement
Guest User

Untitled

a guest
Aug 13th, 2017
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.31 KB | None | 0 0
  1. import redis
  2.  
  3. RATE_LIMITER_SCRIPT = "" # Change it here to the value the SCRIPT LOAD returned
  4. HALF_SECOND_LIMIT = 0 # Change to the limit you have recalculated
  5.  
  6. r = redis.StrictRedis()
  7. if int(r.evalsha(RATE_LIMITER_SCRIPT, 0, {})) <= HALF_SECOND_LIMIT:
  8.     call_riot_api()
  9. else:
  10.     rate_limit_reached()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement