mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-05-06 05:27:44 +03:00
update default zmq timeout
This commit is contained in:
parent
96d89eb50c
commit
9a415e1fc9
@ -6,6 +6,8 @@ from typing import Optional
|
|||||||
|
|
||||||
import zmq
|
import zmq
|
||||||
|
|
||||||
|
from frigate.const import FAST_QUEUE_TIMEOUT
|
||||||
|
|
||||||
SOCKET_PUB = "ipc:///tmp/cache/proxy_pub"
|
SOCKET_PUB = "ipc:///tmp/cache/proxy_pub"
|
||||||
SOCKET_SUB = "ipc:///tmp/cache/proxy_sub"
|
SOCKET_SUB = "ipc:///tmp/cache/proxy_sub"
|
||||||
|
|
||||||
@ -77,7 +79,9 @@ class Subscriber:
|
|||||||
self.socket.setsockopt_string(zmq.SUBSCRIBE, self.topic)
|
self.socket.setsockopt_string(zmq.SUBSCRIBE, self.topic)
|
||||||
self.socket.connect(SOCKET_SUB)
|
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."""
|
"""Returns message or None if no update."""
|
||||||
try:
|
try:
|
||||||
has_update, _, _ = zmq.select([self.socket], [], [], timeout)
|
has_update, _, _ = zmq.select([self.socket], [], [], timeout)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user