From d7ed4543324c7862ac405a6b261bb3c9701006f1 Mon Sep 17 00:00:00 2001 From: Variet Worker Date: Wed, 11 Mar 2026 23:01:24 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EB=82=98=EB=85=B8=20=EA=B2=80=EC=A6=9D?= =?UTF-8?q?=20=E2=80=94=20health=20URL/response=20polling/startup=20?= =?UTF-8?q?=EC=83=81=ED=83=9C=EB=B3=80=EA=B2=BD=203=EA=B1=B4=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. health_check: /../health → /health (URL 해석 오류) 2. response polling: startup pending 제외 (불필요한 HTTP 요청 방지) 3. startup pending 상태변경: pending→skip, auto_resolved/expired→forward --- bridge.py | 2 +- collector.py | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/bridge.py b/bridge.py index a4c6b6e..7e1116b 100644 --- a/bridge.py +++ b/bridge.py @@ -253,7 +253,7 @@ class RemoteTransport(BridgeTransport): async def health_check(self) -> bool: """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" # ─── Async methods (used by Collector) ─── diff --git a/collector.py b/collector.py index 4e72a1e..f0fc6c3 100644 --- a/collector.py +++ b/collector.py @@ -113,8 +113,12 @@ class CollectorBridge: continue # No change is_new = rid not in self._forwarded_pending - if is_new and rid in self._startup_pending: - continue # Skip pre-existing files from before startup + if rid in self._startup_pending: + # 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) await self.remote.awrite_json("pending", fname, data) @@ -146,6 +150,8 @@ class CollectorBridge: try: # Check each forwarded pending for a response 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") if data is None or data.get("waiting"): continue