From ce3e372459671e86b7d5f1651169dac58669e55f Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Wed, 23 Oct 2019 11:30:11 +0100 Subject: [PATCH] Allow some time between thread start and becoming alive --- threads.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/threads.py b/threads.py index e85509294..d5e5c4def 100644 --- a/threads.py +++ b/threads.py @@ -85,18 +85,18 @@ def removeDormantThreads(baseDir: str,threadsList: [],debug: bool) -> None: if th.isStarted: if not th.is_alive(): - if debug: - print('DEBUG: thread is not alive') - removeThread=True - else: - # timeout for started threads - if (currTime-th.startTime).total_seconds()>120: + if (currTime-th.startTime).total_seconds()>10: if debug: - print('DEBUG: started thread timed out') + print('DEBUG: thread is not alive ten seconds after start') removeThread=True + # timeout for started threads + if (currTime-th.startTime).total_seconds()>120: + if debug: + 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 (currTime-th.startTime).total_seconds()>600: if debug: print('DEBUG: unstarted thread timed out') removeThread=True