Timeout for unstarted threads

main2
Bob Mottram 2019-10-23 11:21:41 +01:00
parent 049da094da
commit 68c3e03279
1 changed files with 9 additions and 2 deletions

View File

@ -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: