From b023cda55dea22d0a4301c75f6a8cb52233e2f3d Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Wed, 23 Oct 2019 11:23:43 +0100 Subject: [PATCH] Avoid condition if already true --- threads.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/threads.py b/threads.py index c2b04ce7a..e85509294 100644 --- a/threads.py +++ b/threads.py @@ -88,11 +88,12 @@ def removeDormantThreads(baseDir: str,threadsList: [],debug: bool) -> None: if debug: print('DEBUG: thread is not alive') 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 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: