Change default zmq timeout (#17971)

* update default zmq timeout

* use lower default timeout

* keep longer timeout for event maintainer

* remove default

* remove
This commit is contained in:
Josh Hawkins
2025-04-30 08:29:16 -06:00
committed by GitHub
parent 96d89eb50c
commit 377b78af11
4 changed files with 11 additions and 10 deletions
-3
View File
@@ -39,9 +39,6 @@ class EventMetadataSubscriber(Subscriber):
def __init__(self, topic: EventMetadataTypeEnum) -> None:
super().__init__(topic.value)
def check_for_update(self, timeout: float = 1) -> tuple | None:
return super().check_for_update(timeout)
def _return_object(self, topic: str, payload: tuple) -> tuple:
if payload is None:
return (None, None)
+5 -1
View File
@@ -6,6 +6,8 @@ from typing import Optional
import zmq
from frigate.const import FAST_QUEUE_TIMEOUT
SOCKET_PUB = "ipc:///tmp/cache/proxy_pub"
SOCKET_SUB = "ipc:///tmp/cache/proxy_sub"
@@ -77,7 +79,9 @@ class Subscriber:
self.socket.setsockopt_string(zmq.SUBSCRIBE, self.topic)
self.socket.connect(SOCKET_SUB)
def check_for_update(self, timeout: float = 1) -> Optional[tuple[str, any]]:
def check_for_update(
self, timeout: float = FAST_QUEUE_TIMEOUT
) -> Optional[tuple[str, any]]:
"""Returns message or None if no update."""
try:
has_update, _, _ = zmq.select([self.socket], [], [], timeout)