From 028a145505ebd7442c1c0f922c32aa74ed172413 Mon Sep 17 00:00:00 2001 From: James Turk Date: Fri, 13 Apr 2012 13:37:45 -0400 Subject: [PATCH] change how post_update_tasks fire --- oyster/celeryconfig.py | 3 ++- oyster/tasks.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) 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