def run_task_on_es(taskname, index, type, id, field): """Run named task on single document given by (index, type, id, field). taskname must be the fully qualified name of a function, except for built-in xtas.tasks.single tasks, which are addressed by their short name. Only works for tasks in xtas.tasks.single and custom tasks, not clustering tasks. """ # XXX custom tasks could be batch tasks, but we don't check for that. task = _get_task(taskname) return chain(task.s(es_document(index, type, id, field)) | store_single.s(taskname, index, type, id) ).delay().id + "\n"
def run_task_on_es(taskname, index, type, id, field): """Run named task on single document given by (index, type, id, field). taskname must be the fully qualified name of a function, except for built-in xtas.tasks.single tasks, which are addressed by their short name. Only works for tasks in xtas.tasks.single and custom tasks, not clustering tasks. """ # XXX custom tasks could be batch tasks, but we don't check for that. task = _get_task(taskname) return chain( task.s(es_document(index, type, id, field)) | store_single.s(taskname, index, type, id)).delay().id + "\n"
def run_task_on_es(taskname, index, type, id, field): """Run named task on single document given by (index, type, id, field). taskname must be the fully qualified name of a function, except for built-in xtas.tasks.single tasks, which are addressed by their short name. Only works for tasks in xtas.tasks.single and custom tasks, not clustering tasks. """ # XXX custom tasks could be batch tasks, but we don't check for that. try: if '.' not in taskname: taskname = 'xtas.tasks.single.%s' % taskname task = taskq.tasks[taskname] except KeyError: if app.debug: raise else: abort(404) return chain( task.s(es_document(index, type, id, field)) | store_single.s(taskname, index, type, id)).delay().id
def run_task_on_es(taskname, index, type, id, field): """Run named task on single document given by (index, type, id, field). taskname must be the fully qualified name of a function, except for built-in xtas.tasks.single tasks, which are addressed by their short name. Only works for tasks in xtas.tasks.single and custom tasks, not clustering tasks. """ # XXX custom tasks could be batch tasks, but we don't check for that. try: if '.' not in taskname: taskname = 'xtas.tasks.single.%s' % taskname task = taskq.tasks[taskname] except KeyError: if app.debug: raise else: abort(404) return chain(task.s(es_document(index, type, id, field)) | store_single.s(taskname, index, type, id) ).delay().id