Lower onvif timeouts to 10s (#13473)

This commit is contained in:
Josh Hawkins 2024-08-31 16:15:10 -05:00 committed by GitHub
parent ecaba82c9d
commit e3da5ef2d5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -8,6 +8,7 @@ from pathlib import Path
import numpy import numpy
from onvif import ONVIFCamera, ONVIFError from onvif import ONVIFCamera, ONVIFError
from zeep.exceptions import Fault, TransportError from zeep.exceptions import Fault, TransportError
from zeep.transports import Transport
from frigate.config import FrigateConfig, ZoomingModeEnum from frigate.config import FrigateConfig, ZoomingModeEnum
from frigate.types import PTZMetricsTypes from frigate.types import PTZMetricsTypes
@ -45,6 +46,7 @@ class OnvifController:
if cam.onvif.host: if cam.onvif.host:
try: try:
transport = Transport(timeout=10, operation_timeout=10)
self.cams[cam_name] = { self.cams[cam_name] = {
"onvif": ONVIFCamera( "onvif": ONVIFCamera(
cam.onvif.host, cam.onvif.host,
@ -55,6 +57,7 @@ class OnvifController:
Path(find_spec("onvif").origin).parent / "wsdl" Path(find_spec("onvif").origin).parent / "wsdl"
).replace("dist-packages/onvif", "site-packages"), ).replace("dist-packages/onvif", "site-packages"),
adjust_time=cam.onvif.ignore_time_mismatch, adjust_time=cam.onvif.ignore_time_mismatch,
transport=transport,
), ),
"init": False, "init": False,
"active": False, "active": False,