From 7c77f16ff773b4c738e9c346202c45ec2151b746 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Wed, 16 Oct 2019 17:03:45 +0100 Subject: [PATCH] Start thread on init --- threads.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/threads.py b/threads.py index 880bc12d1..1d1eb5ba0 100644 --- a/threads.py +++ b/threads.py @@ -14,7 +14,7 @@ import datetime class threadWithTrace(threading.Thread): def __init__(self, *args, **keywords): - self.startTime=None + self.startTime=datetime.datetime.utcnow() tries=0 while tries<3: try: @@ -34,7 +34,6 @@ class threadWithTrace(threading.Thread): self.__run_backup = self.run self.run = self.__run threading.Thread.start(self) - self.startTime=datetime.datetime.utcnow() break except Exception as e: print('ERROR: threads.py/start failed - '+str(e))