Set stop event first (#16466)

This commit is contained in:
Nicolas Mowen 2025-02-10 20:22:33 -07:00 committed by GitHub
parent 9a0211a71c
commit ac3dfbc30d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -39,6 +39,7 @@ class WebPushClient(Communicator): # type: ignore[misc]
def __init__(self, config: FrigateConfig, stop_event: MpEvent) -> None:
self.config = config
self.stop_event = stop_event
self.claim_headers: dict[str, dict[str, str]] = {}
self.refresh: int = 0
self.web_pushers: dict[str, list[WebPusher]] = {}
@ -51,7 +52,6 @@ class WebPushClient(Communicator): # type: ignore[misc]
target=self._process_notifications, daemon=True
)
self.notification_thread.start()
self.stop_event = stop_event
if not self.config.notifications.email:
logger.warning("Email must be provided for push notifications to be sent.")