Start thread on init

main2
Bob Mottram 2019-10-16 17:03:45 +01:00
parent fea921ffec
commit 7c77f16ff7
1 changed files with 1 additions and 2 deletions

View File

@ -14,7 +14,7 @@ import datetime
class threadWithTrace(threading.Thread): class threadWithTrace(threading.Thread):
def __init__(self, *args, **keywords): def __init__(self, *args, **keywords):
self.startTime=None self.startTime=datetime.datetime.utcnow()
tries=0 tries=0
while tries<3: while tries<3:
try: try:
@ -34,7 +34,6 @@ class threadWithTrace(threading.Thread):
self.__run_backup = self.run self.__run_backup = self.run
self.run = self.__run self.run = self.__run
threading.Thread.start(self) threading.Thread.start(self)
self.startTime=datetime.datetime.utcnow()
break break
except Exception as e: except Exception as e:
print('ERROR: threads.py/start failed - '+str(e)) print('ERROR: threads.py/start failed - '+str(e))