ServiceMap: update dependencies and backend/app (+5 areas)
Public changes compared with the previous published export: 16 files changed. Affected areas: - backend/app: 3 files - dependencies: 5 files - deployment and CI: 2 files - documentation: 2 files - frontend/src: 1 file - project files: 1 file - tests: 2 files Changed files: - Updated: ".env.example" - Updated: "Dockerfile.unraid" - Updated: "README.md" - Updated: "backend/app/incidents.py" - Updated: "backend/app/main.py" - Updated: "backend/app/store.py" - Updated: "backend/pyproject.toml" - Updated: "backend/tests/test_docker_provider.py" - Updated: "backend/tests/test_v163_health_performance.py" - Updated: "docker-compose.broker.yml" - Updated: "docs/ARCHITECTURE.md" - Updated: "frontend/package-lock.json" - Updated: "frontend/package.json" - Updated: "frontend/src/App.tsx" - Updated: "package-lock.json" - Updated: "package.json" Export provenance/manifests refreshed; excluded from the change summary. Publish curated ServiceMap source from 8c297f756ff84aaa917ae9c48535e835f8c09ec7
This commit is contained in:
1 parent
d4c351ce73
commit
41a8eee259
18 files changed
+167
-92
No files matched your search
@@ -97,14 +97,23 @@ def _severity(service: Service) -> Criticality:
|
||||
# concurrent passes could both see "no active incident" for a root and each
|
||||
# open one (the later duplicate cleanup then left two journal entries).
|
||||
_SYNC_LOCK = threading.RLock()
|
||||
_DEFAULT_RESOLUTION_REASON = "Hoofdoorzaak hersteld; incident opgelost"
|
||||
|
||||
|
||||
def sync_incidents(store: Store, *, resolution_reason: str = "Hoofdoorzaak hersteld; incident opgelost") -> list[IncidentRecord]:
|
||||
def sync_incidents(store: Store, *, resolution_reason: str = _DEFAULT_RESOLUTION_REASON) -> list[IncidentRecord]:
|
||||
with _SYNC_LOCK:
|
||||
return _sync_incidents_locked(store, resolution_reason=resolution_reason)
|
||||
_sync_incidents_locked(store, resolution_reason=resolution_reason)
|
||||
return store.list_incidents(active_only=False)
|
||||
|
||||
|
||||
def _sync_incidents_locked(store: Store, *, resolution_reason: str) -> list[IncidentRecord]:
|
||||
def reconcile_incidents(store: Store) -> tuple[TopologyHealth, IncidentOverview]:
|
||||
with _SYNC_LOCK:
|
||||
return _sync_incidents_locked(store, resolution_reason=_DEFAULT_RESOLUTION_REASON)
|
||||
|
||||
|
||||
def _sync_incidents_locked(
|
||||
store: Store, *, resolution_reason: str
|
||||
) -> tuple[TopologyHealth, IncidentOverview]:
|
||||
"""Reconcile the current graph with the durable incident journal.
|
||||
|
||||
A root service has at most one active incident. Repeated probe cycles only
|
||||
@@ -117,7 +126,7 @@ def _sync_incidents_locked(store: Store, *, resolution_reason: str) -> list[Inci
|
||||
now = datetime.now(UTC)
|
||||
active: dict[str, IncidentRecord] = {}
|
||||
for incident in sorted(
|
||||
store.list_incidents(active_only=True),
|
||||
store.list_incidents(active_only=True, services=services),
|
||||
key=lambda item: (item.detected_at, item.id),
|
||||
):
|
||||
if incident.root_service_id in active:
|
||||
@@ -191,4 +200,4 @@ def _sync_incidents_locked(store: Store, *, resolution_reason: str) -> list[Inci
|
||||
)
|
||||
store.upsert_incident(resolved)
|
||||
store.append_incident_event(incident.id, "incident.resolved", resolution_reason, root_id)
|
||||
return store.list_incidents(active_only=False)
|
||||
return health, overview
|
||||
Reference in new issue
Block a user