mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-08-11 05:11:13 +03:00
CI / AMD64 Build (push) Canceled after 0s
CI / ARM Build (push) Canceled after 0s
CI / Jetson Jetpack 6 (push) Canceled after 0s
CI / AMD64 Extra Build (push) Canceled after 0s
CI / ARM Extra Build (push) Canceled after 0s
CI / Synaptics Build (push) Canceled after 0s
CI / Assemble and push default build (push) Canceled after 0s
* fix watchdog process restarts reverting to the boot config /api/config/set parses a new FrigateConfig and swaps the API and dispatcher onto it, but FrigateApp.config was never rebound, so the watchdog factories rebuilt a crashed process from the config as of startup. Fix is to read through a ConfigHolder that the swap updates. * fix birdseye camera overrides being clobbered by a global mode change A global birdseye save published only the global object, leaving the output process to infer which cameras were inheriting by comparing against the previous global mode. That cannot tell an inherited value from an explicit one that happens to match, so it overwrote the override until a restart. Publish the per-camera values the config parse already resolved instead. * Reject non-finite numbers in GenAI review descriptions A model returning NaN for confidence or potential_threat_level slipped through the model_construct fallback, which skips validation, and was written into the review segment's JSON data. NaN is not valid JSON, so every subsequent /review request failed with "Out of range float values are not JSON compliant", blanking the review page for any time range containing the poisoned row. * restore fused DetectionOutput in the OpenVINO SSD model conversion * fix rgb swap issue for face dataset testing script
64 lines
2.2 KiB
Python
64 lines
2.2 KiB
Python
"""Shared helpers for applying a freshly parsed config to the running app."""
|
|
|
|
from fastapi import FastAPI
|
|
|
|
from frigate.config import FrigateConfig
|
|
from frigate.config.camera.updater import (
|
|
CameraConfigUpdateEnum,
|
|
CameraConfigUpdateTopic,
|
|
)
|
|
|
|
|
|
def publish_camera_section_updates(
|
|
app: FastAPI, config: FrigateConfig, update_type: CameraConfigUpdateEnum
|
|
) -> None:
|
|
"""Broadcast every camera's re-resolved value for a global section.
|
|
|
|
Global sections are folded into each camera at parse time and the camera
|
|
copies are what workers read, so send them rather than leave a worker to
|
|
guess which cameras were inheriting.
|
|
"""
|
|
for camera_name, camera_config in config.cameras.items():
|
|
settings = getattr(camera_config, update_type.name, None)
|
|
|
|
if settings is None:
|
|
continue
|
|
|
|
app.config_publisher.publish_update(
|
|
CameraConfigUpdateTopic(update_type, camera_name), settings
|
|
)
|
|
|
|
|
|
def swap_runtime_config(app: FastAPI, config: FrigateConfig) -> None:
|
|
"""Point every long-lived collaborator at a newly parsed config object.
|
|
|
|
Both /api/config/set and camera deletion re-parse yaml into a fresh
|
|
FrigateConfig and must rebind the same set of references, or the API and
|
|
the dispatcher drift onto different objects (the API reports one camera
|
|
state while the dispatcher acts on another). Runtime toggle overrides are
|
|
re-layered last: the swap rebuilt every camera from yaml, so without this a
|
|
camera the user turned off would silently come back on.
|
|
"""
|
|
app.frigate_config = config
|
|
|
|
if app.config_holder is not None:
|
|
app.config_holder.set(config)
|
|
|
|
app.genai_manager.update_config(config)
|
|
|
|
if app.profile_manager is not None:
|
|
app.profile_manager.update_config(config)
|
|
|
|
if app.stats_emitter is not None:
|
|
app.stats_emitter.config = config
|
|
|
|
if app.dispatcher is not None:
|
|
app.dispatcher.config = config
|
|
|
|
for comm in app.dispatcher.comms:
|
|
comm.config = config
|
|
|
|
# workers still hold the live toggle values, so correct only the
|
|
# config object here rather than re-broadcasting every override
|
|
app.dispatcher.reapply_runtime_state_to_config()
|