change how post_update_tasks fire

This commit is contained in:
James Turk 2012-04-13 13:37:45 -04:00
parent 7b096d76d0
commit 028a145505
2 changed files with 4 additions and 2 deletions

View File

@ -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

View File

@ -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