Skip to content

Commit

Permalink
MNT Remove duplication missed in merge conflict resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
gadorlhiac committed Mar 18, 2024
1 parent 678006a commit cedcf4e
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions subprocess_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit cedcf4e

Please sign in to comment.