feat(reporter): track last_heal_timestamp in state snapshot
This commit is contained in:
1 parent
3b1e25d5cd
commit
a2030a71b7
2 files changed
+28
No files matched your search
@@ -46,6 +46,7 @@ class LocalStateReporter:
|
||||
metadata_drift_count=0,
|
||||
last_drift_fingerprint="",
|
||||
last_heal_result=None,
|
||||
last_heal_timestamp=None,
|
||||
checks_increment=0,
|
||||
heal_result=None,
|
||||
):
|
||||
@@ -58,8 +59,15 @@ class LocalStateReporter:
|
||||
if last_heal_result is not None
|
||||
else previous.get("last_heal_result")
|
||||
)
|
||||
effective_last_heal_timestamp = (
|
||||
last_heal_timestamp
|
||||
if last_heal_timestamp is not None
|
||||
else previous.get("last_heal_timestamp")
|
||||
)
|
||||
if heal_result is not None:
|
||||
effective_heal_result = heal_result
|
||||
if effective_last_heal_timestamp is None:
|
||||
effective_last_heal_timestamp = datetime.now().isoformat()
|
||||
|
||||
checks_total = max(0, self._get_int(previous, "checks_total", 0))
|
||||
checks_total += max(0, int(checks_increment))
|
||||
@@ -84,6 +92,7 @@ class LocalStateReporter:
|
||||
"metadata_drift_count": metadata_drift_count,
|
||||
"last_drift_fingerprint": last_drift_fingerprint,
|
||||
"last_heal_result": effective_heal_result,
|
||||
"last_heal_timestamp": effective_last_heal_timestamp,
|
||||
"uptime_seconds": uptime_seconds,
|
||||
"checks_total": checks_total,
|
||||
"heals_total": heals_total,
|
||||
|
||||
Reference in new issue
Block a user