diff --git a/pagure/default_config.py b/pagure/default_config.py index 56bae2d..3e8f546 100644 --- a/pagure/default_config.py +++ b/pagure/default_config.py @@ -83,6 +83,9 @@ MAX_CONTENT_LENGTH = 4 * 1024 * 1024 # 4 megabytes # IP addresses allowed to access the internal endpoints IP_ALLOWED_INTERNAL = ['127.0.0.1', 'localhost', '::1'] +# Worker configuration +CELERY_CONFIG = {} + # Redis configuration EVENTSOURCE_SOURCE = None WEBHOOK = False diff --git a/pagure/lib/tasks.py b/pagure/lib/tasks.py index 01da2f0..cbdf53d 100644 --- a/pagure/lib/tasks.py +++ b/pagure/lib/tasks.py @@ -32,6 +32,7 @@ _log = logging.getLogger(__name__) conn = Celery('tasks', broker='redis://%s' % APP.config['REDIS_HOST'], backend='redis://%s' % APP.config['REDIS_HOST']) +conn.conf.update(APP.config['CELERY_CONFIG']) def get_result(uuid): diff --git a/tests/test_config b/tests/test_config index d52090c..f5f56dc 100644 --- a/tests/test_config +++ b/tests/test_config @@ -1 +1,3 @@ PAGURE_CI_SERVICES = ['jenkins'] +# Execute tasks without worker +CELERY_CONFIG = {'CELERY_ALWAYS_EAGER': True}