don't start up unnecesserily

This commit is contained in:
Jakob Ketterl 2019-09-21 15:24:06 +02:00
parent 671509df3b
commit 6ec85aa349
2 changed files with 2 additions and 1 deletions

View File

@ -635,7 +635,6 @@ class CpuUsageThread(threading.Thread):
def getSharedInstance(): def getSharedInstance():
if CpuUsageThread.sharedInstance is None: if CpuUsageThread.sharedInstance is None:
CpuUsageThread.sharedInstance = CpuUsageThread() CpuUsageThread.sharedInstance = CpuUsageThread()
CpuUsageThread.sharedInstance.start()
return CpuUsageThread.sharedInstance return CpuUsageThread.sharedInstance
def __init__(self): def __init__(self):
@ -679,6 +678,8 @@ class CpuUsageThread(threading.Thread):
def add_client(self, c): def add_client(self, c):
self.clients.append(c) self.clients.append(c)
if not self.is_alive():
self.start()
def remove_client(self, c): def remove_client(self, c):
try: try:

View File