Allow some time between thread start and becoming alive

main2
Bob Mottram 2019-10-23 11:30:11 +01:00
parent b023cda55d
commit ce3e372459
1 changed files with 8 additions and 8 deletions

View File

@ -85,18 +85,18 @@ def removeDormantThreads(baseDir: str,threadsList: [],debug: bool) -> None:
if th.isStarted: if th.isStarted:
if not th.is_alive(): if not th.is_alive():
if debug: if (currTime-th.startTime).total_seconds()>10:
print('DEBUG: thread is not alive')
removeThread=True
else:
# timeout for started threads
if (currTime-th.startTime).total_seconds()>120:
if debug: if debug:
print('DEBUG: started thread timed out') print('DEBUG: thread is not alive ten seconds after start')
removeThread=True removeThread=True
# timeout for started threads
if (currTime-th.startTime).total_seconds()>120:
if debug:
print('DEBUG: started thread timed out')
removeThread=True
else: else:
# timeout for threads which havn't been started # timeout for threads which havn't been started
if (currTime-th.startTime).total_seconds()>60*10: if (currTime-th.startTime).total_seconds()>600:
if debug: if debug:
print('DEBUG: unstarted thread timed out') print('DEBUG: unstarted thread timed out')
removeThread=True removeThread=True