box-o-sand/ares/server/__init__.py
Dan Buch bfc97737b4 doing some light relation-like stuff
although I spent way too much time on the server side since deciding
to add Redis as "persistence".
2012-05-18 11:18:41 -04:00

16 lines
292 B
Python

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())