Fix stats prefix (#4505)

This commit is contained in:
Nicolas Mowen 2022-11-24 19:12:43 -07:00 committed by GitHub
parent 1f4ce6ff1e
commit 4e5512e35d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 6 deletions

View File

@ -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()

View File

@ -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...")