celery: Reorder celery imports to fix case where celery tasks were being

registered before celery config was setup. Added comments to make this
clear so we don't chase this problem in the future until it is refactored
This commit is contained in:
Daniel Dourvaris 2016-08-11 02:08:54 +03:00
parent a5fa6cfaca
commit 562d672a0c
2 changed files with 8 additions and 4 deletions

View file

@ -34,11 +34,16 @@ from pylons.configuration import PylonsConfig
from pylons.error import handle_mako_error
from pyramid.settings import asbool
# don't remove this import it does magic for celery
from rhodecode.lib import celerypylons # noqa
# ------------------------------------------------------------------------------
# CELERY magic until refactor - issue #4163 - import order matters here:
from rhodecode.lib import celerypylons # this must be first, celerypylons
# sets config settings upon import
import rhodecode.lib.app_globals as app_globals
import rhodecode.integrations # any modules using celery task
# decorators should be added afterwards:
# ------------------------------------------------------------------------------
from rhodecode.lib import app_globals
from rhodecode.config import utils
from rhodecode.config.routing import make_map
from rhodecode.config.jsroutes import generate_jsroutes_content

View file

@ -39,7 +39,6 @@ from routes.middleware import RoutesMiddleware
import routes.util
import rhodecode
import rhodecode.integrations # do not remove this as it registers celery tasks
from rhodecode.config import patches
from rhodecode.config.routing import STATIC_FILE_PREFIX
from rhodecode.config.environment import (