From 94838450d8c137e79ebf4b8bb6056bb7bc9e8b69 Mon Sep 17 00:00:00 2001 From: umsangdon Date: Fri, 16 Oct 2026 06:26:09 +0900 Subject: [PATCH] =?UTF-8?q?fix(=EC=9D=BC=EC=9C=84=EB=8C=80=EA=B0=80?= =?UTF-8?q?=EC=8B=A4=EB=AC=B4):=20339=20=EB=8D=A7=EA=B3=A0=EC=B9=A8=204=20?= =?UTF-8?q?=E2=80=94=20=EC=9A=B0=EB=A6=AC=20=EC=A7=80=EB=AC=B8=20build()?= =?UTF-8?q?=20=EA=B0=80=20=EB=A9=94=EB=AA=A8(=ED=91=9C=20=C2=B7=20?= =?UTF-8?q?=ED=91=9C=ED=8C=90)=EA=B9=8C=EC=A7=80=20=EA=B0=B1=EC=8B=A0=20?= =?UTF-8?q?=C2=B7=20warm()=20=EC=A4=91=EB=B3=B5=20=EA=B0=B1=EC=8B=A0=20?= =?UTF-8?q?=EC=A4=84=20=EC=A7=80=EC=9B=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 빈 캐시 폴더에서 table() 이 None 을 먼저 메모하면 build() 뒤에도 ready() 거짓 · 맞춤 「맞음」 0 이던 흠 - 시험: 캐시 쓰기 읽기 준비 전 none 에 build 직후 ready() 참 · table() = build 결과 한 줄 Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01Ji4nuyLVHcxrXWHTdb5nRD --- M02_MasterTemplete/M02_Hopyo_Ours.py | 7 +++---- resources/tester/test_m02_hopyo_ours.py | 1 + 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/M02_MasterTemplete/M02_Hopyo_Ours.py b/M02_MasterTemplete/M02_Hopyo_Ours.py index 667958381..92272c4ad 100644 --- a/M02_MasterTemplete/M02_Hopyo_Ours.py +++ b/M02_MasterTemplete/M02_Hopyo_Ours.py @@ -326,6 +326,8 @@ def build(ver: str | None = None) -> list[dict]: ver = ver or version() table = [fingerprint(one["로직"], one["단위"]) for one in hopyo_match.targets()["로직"]] atomic_write_json(path_of(ver), {"판": ver, "지문판": FP_VERSION, "표": table}) + with _LOCK: + _STATE.update(표=table, 표판=ver) return table @@ -351,10 +353,7 @@ def warm(build_missing: bool = False) -> threading.Thread | None: def work() -> None: try: if table() is None and build_missing: - ver = version() - got = build(ver) - with _LOCK: - _STATE.update(표=got, 표판=ver) + build(version()) except Exception: # noqa: BLE001 — 마스터가 깨져도 서버를 막지 않음(보기에서 「준비 중」) pass diff --git a/resources/tester/test_m02_hopyo_ours.py b/resources/tester/test_m02_hopyo_ours.py index 4027d9d66..bc9414960 100644 --- a/resources/tester/test_m02_hopyo_ours.py +++ b/resources/tester/test_m02_hopyo_ours.py @@ -34,6 +34,7 @@ def test_캐시_쓰기_읽기_준비_전_none(cache): built = ours.build() assert [o["로직"] for o in built] == ["GC000198", "GC000211", "GC000268"] assert ours.path_of().parent == cache and ours.path_of().is_file() + assert ours.ready() and ours.table() == built ours._STATE.update(표판=None, 표=None) assert [o["로직"] for o in ours.table()] == ["GC000198", "GC000211", "GC000268"] assert master_hash() == before