From e93b76306aa05bfd78e88828400934ad438d9a2e Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Jun 18 2015 11:04:27 +0000 Subject: Only instantiate the connection with redis if there is an eventsource at the end --- diff --git a/pagure/__init__.py b/pagure/__init__.py index 8c9d825..16ed98c 100644 --- a/pagure/__init__.py +++ b/pagure/__init__.py @@ -54,11 +54,13 @@ if 'PAGURE_CONFIG' in os.environ: FAS = FAS(APP) SESSION = pagure.lib.create_session(APP.config['DB_URL']) -POOL = redis.ConnectionPool( - host=APP.config['REDIS_HOST'], - port=APP.config['REDIS_PORT'], - db=APP.config['REDIS_DB']) -REDIS = redis.StrictRedis(connection_pool=POOL) +REDIS=None +if APP.config['EVENTSOURCE_SOURCE']: + POOL = redis.ConnectionPool( + host=APP.config['REDIS_HOST'], + port=APP.config['REDIS_PORT'], + db=APP.config['REDIS_DB']) + REDIS = redis.StrictRedis(connection_pool=POOL) if not APP.debug: APP.logger.addHandler(pagure.mail_logging.get_mail_handler(