Changeset View
Changeset View
Standalone View
Standalone View
swh/scheduler/celery_backend/config.py
Show First 20 Lines • Show All 182 Lines • ▼ Show 20 Lines | |||||
if CONFIG_NAME: | if CONFIG_NAME: | ||||
# load the celery config from the main config file given as | # load the celery config from the main config file given as | ||||
# SWH_CONFIG_FILENAME environment variable. | # SWH_CONFIG_FILENAME environment variable. | ||||
# This is expected to have a [celery] section in which we have the | # This is expected to have a [celery] section in which we have the | ||||
# celery specific configuration. | # celery specific configuration. | ||||
SWH_CONFIG.clear() | SWH_CONFIG.clear() | ||||
SWH_CONFIG.update(load_named_config(CONFIG_NAME)) | SWH_CONFIG.update(load_named_config(CONFIG_NAME)) | ||||
CONFIG = SWH_CONFIG.get('celery', default={}) | CONFIG = SWH_CONFIG.get('celery', {}) | ||||
if not CONFIG: | if not CONFIG: | ||||
# otherwise, back to compat config loading mechanism | # otherwise, back to compat config loading mechanism | ||||
if INSTANCE_NAME: | if INSTANCE_NAME: | ||||
CONFIG_NAME = CONFIG_NAME_TEMPLATE % INSTANCE_NAME | CONFIG_NAME = CONFIG_NAME_TEMPLATE % INSTANCE_NAME | ||||
else: | else: | ||||
CONFIG_NAME = DEFAULT_CONFIG_NAME | CONFIG_NAME = DEFAULT_CONFIG_NAME | ||||
▲ Show 20 Lines • Show All 85 Lines • Show Last 20 Lines |