Switch several functions over to using the new callable_run* tools!
This commit is contained in:
parent
0a5c6ec901
commit
04f295e20d
@ -18,7 +18,7 @@ import os
|
|||||||
import sys
|
import sys
|
||||||
|
|
||||||
from celery import Celery
|
from celery import Celery
|
||||||
from mediagoblin.tools.pluginapi import PluginManager
|
from mediagoblin.tools.pluginapi import callable_runall
|
||||||
|
|
||||||
|
|
||||||
MANDATORY_CELERY_IMPORTS = ['mediagoblin.processing.task']
|
MANDATORY_CELERY_IMPORTS = ['mediagoblin.processing.task']
|
||||||
@ -66,8 +66,7 @@ def setup_celery_app(app_config, global_config,
|
|||||||
celery_app = Celery()
|
celery_app = Celery()
|
||||||
celery_app.config_from_object(celery_settings)
|
celery_app.config_from_object(celery_settings)
|
||||||
|
|
||||||
for callable_hook in PluginManager().get_hook_callables('celery_setup'):
|
callable_runall('celery_setup', celery_app)
|
||||||
callable_hook(celery_app)
|
|
||||||
|
|
||||||
|
|
||||||
def setup_celery_from_config(app_config, global_config,
|
def setup_celery_from_config(app_config, global_config,
|
||||||
|
@ -22,7 +22,7 @@ from celery.signals import setup_logging
|
|||||||
|
|
||||||
from mediagoblin import app, mg_globals
|
from mediagoblin import app, mg_globals
|
||||||
from mediagoblin.init.celery import setup_celery_from_config
|
from mediagoblin.init.celery import setup_celery_from_config
|
||||||
from mediagoblin.tools.pluginapi import PluginManager
|
from mediagoblin.tools.pluginapi import callable_runall
|
||||||
|
|
||||||
|
|
||||||
OUR_MODULENAME = __name__
|
OUR_MODULENAME = __name__
|
||||||
@ -47,9 +47,7 @@ def setup_logging_from_paste_ini(loglevel, **kw):
|
|||||||
|
|
||||||
logging.config.fileConfig(logging_conf_file)
|
logging.config.fileConfig(logging_conf_file)
|
||||||
|
|
||||||
for callable_hook in \
|
callable_runall('celery_logging_setup')
|
||||||
PluginManager().get_hook_callables('celery_logging_setup'):
|
|
||||||
callable_hook()
|
|
||||||
|
|
||||||
|
|
||||||
setup_logging.connect(setup_logging_from_paste_ini)
|
setup_logging.connect(setup_logging_from_paste_ini)
|
||||||
|
@ -59,6 +59,4 @@ def setup_plugins():
|
|||||||
pman.register_hooks(plugin.hooks)
|
pman.register_hooks(plugin.hooks)
|
||||||
|
|
||||||
# Execute anything registered to the setup hook.
|
# Execute anything registered to the setup hook.
|
||||||
setup_list = pman.get_hook_callables('setup')
|
pluginapi.callable_runall('setup')
|
||||||
for fun in setup_list:
|
|
||||||
fun()
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user