diff --git a/general/monitor.py b/general/monitor.py index dcd281e..9eef5a1 100644 --- a/general/monitor.py +++ b/general/monitor.py @@ -18,17 +18,13 @@ class CMonitor: def __init__(self, rate=5, switchCPU=False, switchGPU=False, switchHDD=False, switchRAM=False, switchVRAM=False): self.rate = rate self.stats = CStats(switchCPU, switchGPU, switchHDD, switchRAM, switchVRAM) - self.stats.diagnostic() self.startMonitor() async def send_message(self, data) -> None: # I'm not sure if it is ok, but works ¯\_(ツ)_/¯ # I tried to use async with send_json, but eventually that don't send the message - # await s.send_json('crystools.monitor', data) - # lock.acquire() server.PromptServer.instance.send_sync('crystools.monitor', data) - # lock.release() def monitorLoop(self): while self.rate > 0 and not self.threadController.is_set(): diff --git a/general/stats.py b/general/stats.py index 4120e4f..e0cd3ae 100644 --- a/general/stats.py +++ b/general/stats.py @@ -39,6 +39,8 @@ class CStats: self.pynvmlLoaded = False logger.error('Could not init pynvml.' + str(e)) + self.diagnostic() + def buildStatsData(self): cpu = -1 ramTotal = -1