Exemple #1
0
 def __init__(self, memcached_client, interaction_pool):
     self._log = logging.getLogger("InteractionPoolAuthenticator")
     self._interaction_pool = interaction_pool
     self._collection_lookup = CollectionLookup(memcached_client,
                                                interaction_pool)
     self._customer_lookup = CustomerIdLookup(memcached_client,
                                              interaction_pool)
     self._customer_key_lookup = CustomerKeyLookup(memcached_client,
                                                   interaction_pool)
Exemple #2
0
    def init(self):
        #import logging
        #import traceback
        log = logging.getLogger("init")
        log.info("init start")

        self.central_conn_pool = DBInteractionPool(
            get_central_database_dsn(),
            pool_size=CENTRAL_DB_POOL_SIZE,
            do_log=True)

        self.redis = StrictRedis(host=REDIS_HOST, port=REDIS_PORT, db=REDIS_DB)

        self.memcached_client = memcache.Client(MEMCACHED_NODES)

        self.collection_lookup = CollectionLookup(self.memcached_client,
                                                  self.central_conn_pool)

        log.info("init complete")
        self.init_complete.set(True)