mirror of
https://pagure.io/fm-orchestrator.git
synced 2026-02-02 20:59:06 +08:00
Most of the code are moved to dedicated subpackages, but some others can't due to the cycle dependencies. Signed-off-by: Chenxiong Qi <cqi@redhat.com>
19 lines
600 B
Python
19 lines
600 B
Python
# -*- coding: utf-8 -*-
|
|
# SPDX-License-Identifier: MIT
|
|
""" This is a sub-module for backend/scheduler functionality. """
|
|
|
|
from celery import Celery
|
|
|
|
from module_build_service.common.config import conf
|
|
|
|
celery_app = Celery("module-build-service")
|
|
# Convert config names specific for Celery like this:
|
|
# celery_broker_url -> broker_url
|
|
celery_configs = {
|
|
name[7:]: getattr(conf, name)
|
|
for name in dir(conf) if name.startswith("celery_")
|
|
}
|
|
# Only allow a single process so that tasks are always serial per worker
|
|
celery_configs["worker_concurrency"] = 1
|
|
celery_app.conf.update(**celery_configs)
|