You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
box-o-sand/ares/server/__init__.py

16 lines
292 B

import redis
_MEMCACHE = {'pool': None}
def get_pool():
if not _MEMCACHE['pool']:
_MEMCACHE['pool'] = \
redis.ConnectionPool(host='localhost', port=6379, db=0)
return _MEMCACHE['pool']
def get_redis_conn():
return redis.Redis(connection_pool=get_pool())