def _check_cache_state(self): from utils import getmc app_log.debug("start memcached state check thread") while 1: try: client = getmc() client.get_stats() app_log.debug("memcached come back!") self._evthub.emit_system_notify("cacheserver.up", "") break except: app_log.warn("memcached still down!") time.sleep(5)
def get_proxy_mc(): # cache_pool = CacheConnectionPool.instance() # raw_mc = cache_pool.get_connection() from utils import getmc return CacheConnectionProxy(getmc())
def install_cache_pool(): from utils import getmc context['mc'] = getmc()
def _create_raw_connection(self): from utils import getmc return getmc()
def test_mc(): from utils import getmc client = getmc() print client print client.get_stats()