From cedcf4ecd62729f2d759dab854a8c1b97710cc4e Mon Sep 17 00:00:00 2001 From: gadorlhiac Date: Mon, 18 Mar 2024 10:25:06 -0700 Subject: [PATCH] MNT Remove duplication missed in merge conflict resolution --- subprocess_task.py | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/subprocess_task.py b/subprocess_task.py index 5ec86aa4..5e6b1a34 100644 --- a/subprocess_task.py +++ b/subprocess_task.py @@ -13,28 +13,6 @@ from lute.io.models.base import TaskParameters, BaseBinaryParameters -def get_task() -> Optional[Task]: - """Return the current Task.""" - objects: Dict[str, Any] = globals() - for _, obj in objects.items(): - if isinstance(obj, Task): - return obj - return None - - -def timeout_handler(signum: int, frame: types.FrameType) -> None: - """Log and exit gracefully on Task timeout.""" - task: Optional[Task] = get_task() - if task: - msg: Message = Message(contents="Timed out.", signal="TASK_FAILED") - task._report_to_executor(msg) - task.clean_up_timeout() - sys.exit(-1) - - -signal.signal(signal.SIGALRM, timeout_handler) - - def get_task() -> Optional[Task]: """Return the current Task.""" objects: Dict[str, Any] = globals()