00cfca1a57
Live and recording both read from the go2rtc restream. If go2rtc's runtime stream table gets emptied (camera clear via API, go2rtc restart with a stale/empty config, or a silently-failed startup sync_all), every restream returns 404 and both live and recording go dark until a manual `docker restart nvr-go2rtc`. Add a background Reconciler that every 30s diffs the desired streams against go2rtc /api/streams and PUTs only the missing ones (existing streams are left untouched so active producers/consumers are not disrupted). VERSION -> 0.0.115. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
27 lines
700 B
Python
27 lines
700 B
Python
"""Глобальные ссылки на живые компоненты (заполняются в lifespan)."""
|
|
from __future__ import annotations
|
|
|
|
from typing import TYPE_CHECKING
|
|
|
|
if TYPE_CHECKING:
|
|
from .config import Config
|
|
from .db import Database
|
|
from .recorder.indexer import Indexer
|
|
from .recorder.supervisor import Supervisor
|
|
from .services.retention import Retention
|
|
from .services.go2rtc import Reconciler
|
|
from .api.ws import ConnectionManager
|
|
|
|
|
|
class Runtime:
|
|
config: "Config"
|
|
db: "Database"
|
|
supervisor: "Supervisor"
|
|
indexer: "Indexer"
|
|
retention: "Retention"
|
|
reconciler: "Reconciler"
|
|
ws: "ConnectionManager"
|
|
|
|
|
|
runtime = Runtime()
|