fix: 나노 검증 — health URL/response polling/startup 상태변경 3건 수정
1. health_check: /../health → /health (URL 해석 오류) 2. response polling: startup pending 제외 (불필요한 HTTP 요청 방지) 3. startup pending 상태변경: pending→skip, auto_resolved/expired→forward
This commit is contained in:
@@ -253,7 +253,7 @@ class RemoteTransport(BridgeTransport):
|
|||||||
|
|
||||||
async def health_check(self) -> bool:
|
async def health_check(self) -> bool:
|
||||||
"""Check if Gateway is reachable."""
|
"""Check if Gateway is reachable."""
|
||||||
result = await self._arequest("GET", "/../health")
|
result = await self._arequest("GET", "/health")
|
||||||
return result is not None and result.get("status") == "ok"
|
return result is not None and result.get("status") == "ok"
|
||||||
|
|
||||||
# ─── Async methods (used by Collector) ───
|
# ─── Async methods (used by Collector) ───
|
||||||
|
|||||||
10
collector.py
10
collector.py
@@ -113,8 +113,12 @@ class CollectorBridge:
|
|||||||
continue # No change
|
continue # No change
|
||||||
|
|
||||||
is_new = rid not in self._forwarded_pending
|
is_new = rid not in self._forwarded_pending
|
||||||
if is_new and rid in self._startup_pending:
|
if rid in self._startup_pending:
|
||||||
continue # Skip pre-existing files from before startup
|
# Startup files: only forward status CHANGES (not re-forward as new pending)
|
||||||
|
status = data.get("status", "pending")
|
||||||
|
if status == "pending":
|
||||||
|
continue # Still pending from before startup — skip
|
||||||
|
# Status changed (auto_resolved/expired) — forward the update
|
||||||
|
|
||||||
# Forward to Gateway (new or updated)
|
# Forward to Gateway (new or updated)
|
||||||
await self.remote.awrite_json("pending", fname, data)
|
await self.remote.awrite_json("pending", fname, data)
|
||||||
@@ -146,6 +150,8 @@ class CollectorBridge:
|
|||||||
try:
|
try:
|
||||||
# Check each forwarded pending for a response
|
# Check each forwarded pending for a response
|
||||||
for rid in list(self._forwarded_pending):
|
for rid in list(self._forwarded_pending):
|
||||||
|
if rid in self._startup_pending:
|
||||||
|
continue # Don't poll responses for pre-startup files
|
||||||
data = await self.remote.aread_json("response", f"{rid}.json")
|
data = await self.remote.aread_json("response", f"{rid}.json")
|
||||||
if data is None or data.get("waiting"):
|
if data is None or data.get("waiting"):
|
||||||
continue
|
continue
|
||||||
|
|||||||
Reference in New Issue
Block a user