diff --git a/oyster/celeryconfig.py b/oyster/celeryconfig.py index d3e6cb6..2098e01 100644 --- a/oyster/celeryconfig.py +++ b/oyster/celeryconfig.py @@ -1,6 +1,7 @@ from oyster.conf import settings -CELERY_IMPORTS = ["oyster.tasks"] + list(settings.CELERY_TASK_MODULES) +CELERY_IMPORTS = ['oyster.tasks', + 'oyster.ext.cloudsearch'] + list(settings.CELERY_TASK_MODULES) BROKER_TRANSPORT = 'mongodb' BROKER_HOST = settings.MONGO_HOST diff --git a/oyster/tasks.py b/oyster/tasks.py index 2aef105..13810f0 100644 --- a/oyster/tasks.py +++ b/oyster/tasks.py @@ -12,7 +12,8 @@ class UpdateTask(Task): def run(self, doc_id): doc = kernel.db.tracked.find_one({'_id': doc_id}) kernel.update(doc) - for task in doc.get('post_update_tasks', []): + for task in kernel.doc_classes[doc['doc_class']].get( + 'post_update_tasks', []): send_task(task, (doc_id,)) kernel.db.status.update({}, {'$inc': {'update_queue': -1}}) # don't sit on a connection