mirror of
https://github.com/blakeblackshear/frigate.git
synced 2024-12-19 19:06:16 +01:00
Fix stats prefix (#4505)
This commit is contained in:
parent
1f4ce6ff1e
commit
4e5512e35d
@ -316,7 +316,6 @@ class FrigateApp:
|
||||
self.config,
|
||||
self.stats_tracking,
|
||||
self.dispatcher,
|
||||
self.config.mqtt.topic_prefix,
|
||||
self.stop_event,
|
||||
)
|
||||
self.stats_emitter.start()
|
||||
|
@ -147,7 +147,6 @@ class StatsEmitter(threading.Thread):
|
||||
config: FrigateConfig,
|
||||
stats_tracking: StatsTrackingTypes,
|
||||
dispatcher: Dispatcher,
|
||||
topic_prefix: str,
|
||||
stop_event: MpEvent,
|
||||
):
|
||||
threading.Thread.__init__(self)
|
||||
@ -155,14 +154,11 @@ class StatsEmitter(threading.Thread):
|
||||
self.config = config
|
||||
self.stats_tracking = stats_tracking
|
||||
self.dispatcher = dispatcher
|
||||
self.topic_prefix = topic_prefix
|
||||
self.stop_event = stop_event
|
||||
|
||||
def run(self) -> None:
|
||||
time.sleep(10)
|
||||
while not self.stop_event.wait(self.config.mqtt.stats_interval):
|
||||
stats = stats_snapshot(self.stats_tracking)
|
||||
self.dispatcher.publish(
|
||||
f"{self.topic_prefix}/stats", json.dumps(stats), retain=False
|
||||
)
|
||||
self.dispatcher.publish("stats", json.dumps(stats), retain=False)
|
||||
logger.info(f"Exiting watchdog...")
|
||||
|
Loading…
Reference in New Issue
Block a user