clearml_agent/commands/worker.py
def handle_user_abort(self, task_id, session=None):
        """
        Set task status to appropriate value on user abort.
        """
        session = session or self._session
        try:
            task_status = session.send_api(
                tasks_api.GetByIdRequest(task_id)
            ).task.status
            if task_status == tasks_api.TaskStatusEnum.in_progress:
                print("\nUser abort - stopping task {}".format(task_id))
                session.send_api(tasks_api.StoppedRequest(task_id))
        except Exception:
            pass

        Set task status to appropriate value on user abort.
        
Set task status to appropriate value on user abort.
Set task status to appropriate value on user abort .
def handle_user_abort(self, task_id, session=None):
        session = session or self._session
        try:
            task_status = session.send_api(
                tasks_api.GetByIdRequest(task_id)
            ).task.status
            if task_status == tasks_api.TaskStatusEnum.in_progress:
                print("\nUser abort - stopping task {}".format(task_id))
                session.send_api(tasks_api.StoppedRequest(task_id))
        except Exception:
            pass
def handle_user_abort ( self , task_id , session = None ) : session = session or self . _session try : task_status = session . send_api ( tasks_api . GetByIdRequest ( task_id ) ) . task . status if task_status == tasks_api . TaskStatusEnum . in_progress : print ( "\nUser abort - stopping task {}" . format ( task_id ) ) session . send_api ( tasks_api . StoppedRequest ( task_id ) ) except Exception : pass
Set task status to appropriate value on user abort.
Set task status to appropriate value on user abort .
"""
        Set task status to appropriate value on user abort.
        """
self
task_id
session