コード例 #1
0
  def cancel(self, request):
    """Cancels a task.

    If a bot was running the task, the bot will forcibly cancel the task.
    """
    logging.info('%s', request)
    summary_key = task_pack.unpack_result_summary_key(request.task_id)
    ok, was_running = task_scheduler.cancel_task(summary_key)
    return swarming_rpcs.CancelResponse(ok=ok, was_running=was_running)
コード例 #2
0
    def cancel(self, request):
        """Cancels a task.

    If a bot was running the task, the bot will forcibly cancel the task.
    """
        logging.debug('%s', request)
        request_key, result_key = _to_keys(request.task_id)
        request_obj = _get_task_request_async(request.task_id, request_key,
                                              _EDIT).get_result()
        ok, was_running = task_scheduler.cancel_task(
            request_obj, result_key, request.kill_running or False)
        return swarming_rpcs.CancelResponse(ok=ok, was_running=was_running)
コード例 #3
0
 def cancel(self, request):
     """Cancels a task and indicate success."""
     summary_key = task_pack.unpack_result_summary_key(request.task_id)
     ok, was_running = task_scheduler.cancel_task(summary_key)
     return swarming_rpcs.CancelResponse(ok=ok, was_running=was_running)