plugin/raven: Fix paster's celery config issue
Check for CELERY_CONFIG_MODULE before we import raven.contrib.celery. It seems that the import otherwise sets up the celery client before we get to pass it our mediagoblin-specific settings.
This commit is contained in:
parent
35f1f75922
commit
40ef3f5e05
@ -18,13 +18,17 @@ import os
|
|||||||
import logging
|
import logging
|
||||||
|
|
||||||
from mediagoblin.tools import pluginapi
|
from mediagoblin.tools import pluginapi
|
||||||
from raven import Client
|
|
||||||
from raven.contrib.celery import register_signal
|
|
||||||
|
|
||||||
_log = logging.getLogger(__name__)
|
_log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
def setup_plugin():
|
def setup_plugin():
|
||||||
|
if not os.environ.get('CELERY_CONFIG_MODULE'):
|
||||||
|
# Exit early if we're (seemingly) not called from the celery process
|
||||||
|
return
|
||||||
|
|
||||||
|
from raven import Client
|
||||||
|
from raven.contrib.celery import register_signal
|
||||||
config = pluginapi.get_config('mediagoblin.plugins.raven')
|
config = pluginapi.get_config('mediagoblin.plugins.raven')
|
||||||
|
|
||||||
_log.info('Setting up raven for celery...')
|
_log.info('Setting up raven for celery...')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user