Align lifecycle persistence with review isolation and runtime health
Assistant: codex Assistant-Model: gpt-6-astra Assistant-Session: 01a10780-6d41-7952-9718-dfbc1f41236f
This commit is contained in:
parent
b2a4b863a8
commit
f0e9341650
8 changed files with 102 additions and 5 deletions
|
|
@ -47,7 +47,11 @@ class AuditPump:
|
|||
|
||||
def ready(self):
|
||||
with self._lock:
|
||||
return self._last_ok is not None and self.clock() - self._last_ok < 90
|
||||
recent = self._last_ok is not None and self.clock() - self._last_ok < 90
|
||||
try:
|
||||
return recent and self.store.lifecycle_counts()["pending"] == 0
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
def tick(self):
|
||||
try:
|
||||
|
|
@ -78,6 +82,8 @@ class AuditPump:
|
|||
row["state"] != "delivered" for row in self.store.outbox())
|
||||
if self.intake_worker and self.store.intake_audit_pending():
|
||||
healthy = False
|
||||
if self.store.lifecycle_counts()["pending"]:
|
||||
healthy = False
|
||||
with self._lock:
|
||||
self._last_ok = now if healthy else None
|
||||
except Exception:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue