Initial commit

This commit is contained in:
Ben Firshman
2015-11-15 20:59:29 +01:00
commit 87d9e8e07d
18 changed files with 7797 additions and 0 deletions

View File

@ -0,0 +1,17 @@
import time
from redis import Redis, ConnectionError
def connect_to_redis(host):
time.sleep(2)
print "Connecting to redis"
while True:
try:
redis = Redis(host=host, db=0)
redis.ping()
print "Connected to redis"
return redis
except ConnectionError:
print "Failed to connect to redis - retrying"
time.sleep(1)