From f6b844b6e367fc8ec010e79365703057b98d8502 Mon Sep 17 00:00:00 2001 From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> Date: Sat, 30 May 2026 22:20:33 -0500 Subject: [PATCH] defer profile restoration until subscribers are connected --- frigate/app.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/frigate/app.py b/frigate/app.py index b2402d2326..785dc24470 100644 --- a/frigate/app.py +++ b/frigate/app.py @@ -343,13 +343,21 @@ class FrigateApp: ) self.dispatcher.profile_manager = self.profile_manager + def restore_active_profile(self) -> None: + """Re-activate the persisted profile after subscribers are connected. + + ZMQ PUB/SUB drops messages with no subscribers, so activation must + run after every config_updater subscriber is up. + """ + if self.profile_manager is None: + return + persisted = ProfileManager.load_persisted_profile() if persisted and any( persisted in cam.profiles for cam in self.config.cameras.values() ): logger.info("Restoring persisted profile '%s'", persisted) - # don't clear runtime overrides here, restore_runtime_state() later - # in startup replays it on top of the activated profile + # runtime overrides are layered on top via restore_runtime_state() self.profile_manager.activate_profile( persisted, clear_runtime_overrides=False ) @@ -617,6 +625,7 @@ class FrigateApp: self.start_watchdog() # restore persisted runtime overrides on top of config + self.restore_active_profile() self.dispatcher.restore_runtime_state() self.init_auth()