From 68c3e032799b53f25436fd43834baeb108cd8c5c Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Wed, 23 Oct 2019 11:21:41 +0100 Subject: [PATCH] Timeout for unstarted threads --- threads.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/threads.py b/threads.py index 9f59095bc..c2b04ce7a 100644 --- a/threads.py +++ b/threads.py @@ -88,9 +88,16 @@ def removeDormantThreads(baseDir: str,threadsList: [],debug: bool) -> None: if debug: print('DEBUG: thread is not alive') removeThread=True - elif (currTime-th.startTime).total_seconds()>60: + # timeout for started threads + if (currTime-th.startTime).total_seconds()>120: if debug: - print('DEBUG: thread timed out') + print('DEBUG: started thread timed out') + removeThread=True + else: + # timeout for threads which havn't been started + if (currTime-th.startTime).total_seconds()>60*10: + if debug: + print('DEBUG: unstarted thread timed out') removeThread=True if removeThread: