compass-core/compass/utils/celeryconfig_wrapper.py
xiaodongwang 7f080e4e51 fix pep8 warning and move major util code from bin to compass dir.
Change-Id: I7baa536888db1ca46cadcdf07ef9cc0a1a3a12fb
2014-02-19 22:25:45 -08:00

26 lines
591 B
Python

"""celeryconfig wrapper."""
import logging
import os.path
from compass.utils import setting_wrapper as setting
CELERY_RESULT_BACKEND = 'amqp://'
BROKER_URL = 'amqp://guest:guest@localhost:5672//'
CELERY_IMPORTS = ('compass.tasks.tasks',)
if setting.CELERYCONFIG_FILE:
CELERY_CONFIG = os.path.join(
setting.CELERYCONFIG_DIR,
setting.CELERYCONFIG_FILE)
try:
logging.info('load celery config from %s', CELERY_CONFIG)
execfile(CELERY_CONFIG, globals(), locals())
except Exception as error:
logging.exception(error)
raise error