Skip to content

Commit

Permalink
[#1027] Fixes celery configuration to allow overriding from config
Browse files Browse the repository at this point in the history
  • Loading branch information
rossjones committed Jun 19, 2013
1 parent 83b7758 commit 9ddb0e3
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions ckan/lib/celery_app.py
Expand Up @@ -4,7 +4,6 @@

from pylons import config as pylons_config
from pkg_resources import iter_entry_points, VersionConflict
#from celery.loaders.base import BaseLoader

log = logging.getLogger(__name__)

Expand Down Expand Up @@ -49,16 +48,16 @@
log.critical(error)
pass

celery.conf.update(default_config)
celery.loader.conf.update(default_config)

try:
for key, value in config.items('app:celery'):
if key in LIST_PARAMS:
celery.conf[key.upper()] = value.split()
celery.loader.conf[key.upper()] = value.split()
default_config[key.upper()] = value.split()
else:
celery.conf[key.upper()] = value
celery.loader.conf[key.upper()] = value.split()
default_config[key.upper()] = value
except ConfigParser.NoSectionError:
pass

# Thes update of configuration means it is only possible to set each
# key once so this is done once all of the options have been decided.
celery.conf.update(default_config)
celery.loader.conf.update(default_config)

0 comments on commit 9ddb0e3

Please sign in to comment.