Esempio n. 1
0
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"
Esempio n. 2
0
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"
Esempio n. 3
0
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
Esempio n. 4
0
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