Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
import redis
class RedisStorage(object):
_redis_pool = {}
def setup_redis_pool(cls, redis_pool):
for k, v in redis_pool.iteritems():
cls._redis_pool[k] = redis.Redis(v[0], v[1])
def _get_db(self, db_name):
return self._redis_pool.get(db_name, None)
class CommentRedis(RedisStorage):
def add_comment(self, checkin_id, comment_id, comment_data):
r_client = self._get_db("COMMENT")
# u can use redis now
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment