proc_stats: start timers in component init
Avoid adding event loop callbacks in a component's "__init__()" method. Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
parent
0f7af929f1
commit
a5eff12131
|
@ -91,6 +91,8 @@ class ProcStats:
|
|||
self.last_cpu_stats: Dict[str, Tuple[int, int]] = {}
|
||||
self.cpu_usage: Dict[str, float] = {}
|
||||
self.stat_callbacks: List[STAT_CALLBACK] = []
|
||||
|
||||
async def component_init(self) -> None:
|
||||
self.stat_update_timer.start()
|
||||
self.watchdog.start()
|
||||
|
||||
|
|
Loading…
Reference in New Issue