Exemplo n.º 1
0
def revoke_handler(task_id):
    """ Use this API to cancel a pending/running Shiraz job.

        Usage:
        http://shiraz/revoke/89a118cb-563b-4f7c-b548-d947f7069615
        (where 89a118cb-563b-4f7c-b548-d947f7069615 is the Shiraz task ID,
        which you can get from the celery inspect active output, second to
        last field)
    """
    LOG.info("REVOKE: called with task id: " + str(task_id))
    task = MyAsyncResult(task_id)  # @UndefinedVariable
    task.revoke(terminate=True)
    task.revoke(terminate=True)  # XXX: why?!
    bottle.response.add_header('Cache-Control', 'no-cache')
    result = dict(status=task.status)
    LOG.info("REVOKE: Result: " + str(result))
    return result
Exemplo n.º 2
0
def revoke_handler(task_id):
    task = MyAsyncResult(task_id)  # @UndefinedVariable
    task.revoke(terminate=True)
    task.revoke(terminate=True)  # XXX: why?!
    bottle.response.add_header('Cache-Control', 'no-cache')
    return dict(status=task.status)
Exemplo n.º 3
0
def revoke_handler(task_id):
    task = MyAsyncResult(task_id)  # @UndefinedVariable
    task.revoke(terminate=True)
    task.revoke(terminate=True)  # XXX: why?!
    bottle.response.add_header('Cache-Control', 'no-cache')
    return dict(status=task.status)