perf(main): 한 겹 아래 숨은 node_modules 도 리로드 감시에서 뺌

앞 커밋이 바로 밑의 node_modules 만 봐서 새는 곳이 있었음 —
`B07_DesignDetail/openwebcad/node_modules`(15,944개)와
`A00_Common/config/node_modules`. 그 폴더들이 0.25초마다 통째로 훑히고 있었음.

한 겹 아래(`*/node_modules`)까지 보고 제외.

실측 (놀고 있는 서버, 같은 기기·같은 절차) — **CPU 85.2% → 18.3%**.
감시 대상은 파이썬 143개 · 하위폴더 39개로 줄었음.

⚠ 원인 규명은 보조 창 몫이 컸음 — 프로세스 역할이 뒤바뀌어 보였음(내가
띄운 것은 껍데기, 그 자식이 리로더, 손자가 실제 서버). 부모만 보고 재면
0% 로 보여 「앱이 먹는다」로 두 번 오진했음. 갈래 실험(reload 끔 0% /
켬 64%)이 그것을 갈랐음.

남은 18% 는 감시 탓으로 보기 어려움(파일 143개) — 별건으로 남김.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-09-07 07:35:53 +09:00
co-authored by Claude Opus 5
parent 7a1d7db68f
commit e7d3032727
+4 -2
View File
@@ -513,8 +513,10 @@ def _reload_dirs() -> list[str]:
for entry in sorted(root.iterdir()):
if not entry.is_dir() or entry.name.startswith(".") or entry.name in _RELOAD_SKIP:
continue
if (entry / "node_modules").is_dir():
continue # 의존성 트리가 안에 있으면 훑는 값이 이득을 넘는다
# 의존성 트리가 **한 겹 아래에 숨어 있는** 경우도 뺀다 — `B07_DesignDetail/openwebcad/
# node_modules`(15,944개)가 그렇다. 바로 밑만 보면 새어 나간다(2026-09-07 실측).
if (entry / "node_modules").is_dir() or any(entry.glob("*/node_modules")):
continue
if any(entry.rglob("*.py")):
watched.append(str(entry))
return watched