from bodhi.server import bugs, buildsys, initialize_db from bodhi.server.config import config from bodhi.server.util import pyfile_to_module # Workaround https://github.com/celery/celery/issues/5416 if celery.version_info < (4, 3) and sys.version_info >= (3, 7): # pragma: no cover from re import Pattern from celery.app.routes import re as routes_re routes_re._pattern_type = Pattern log = logging.getLogger('bodhi') # The Celery app object. app = celery.Celery() app.config_from_object(pyfile_to_module(config["celery_config"], "celeryconfig")) def _do_init(): config.load_config() initialize_db(config) buildsys.setup_buildsystem(config) bugs.set_bugtracker() @app.task(name="compose") def compose(api_version: int, **kwargs): """Trigger the compose. All arguments besides the ``api_version`` will be transmitted to the task handler.
from bodhi.server.config import config from bodhi.server.util import pyfile_to_module # Workaround https://github.com/celery/celery/issues/5416 if celery.version_info < (4, 3) and sys.version_info >= ( 3, 7): # pragma: no cover from re import Pattern from celery.app.routes import re as routes_re routes_re._pattern_type = Pattern log = logging.getLogger('bodhi') # The Celery app object. app = celery.Celery() app.config_from_object( pyfile_to_module(config["celery_config"], "celeryconfig")) def _do_init(): config.load_config() initialize_db(config) buildsys.setup_buildsystem(config) bugs.set_bugtracker() @app.task(name="compose") def compose(api_version: int, **kwargs): """Trigger the compose. All arguments besides the ``api_version`` will be transmitted to the task handler.