Merge remote-tracking branch 'origin/main_laptop_1' into sub_laptop_1
This commit is contained in:
@@ -505,13 +505,16 @@ def _reload_dirs() -> list[str]:
|
||||
파이썬이 실제로 사는 폴더만 준다 — 화면 코드(TS)는 vite 가 따로 본다.
|
||||
"""
|
||||
root = Path(__file__).resolve().parent
|
||||
# ⚠ 루트 자체는 넣지 않는다 — uvicorn 은 준 폴더를 `rglob("*.py")` 로 **재귀**로 훑으므로
|
||||
# 루트를 주면 storage·venv(파이썬 파일만 7,530개)를 도로 다 훑는다. 그 대신 `main.py`
|
||||
# 를 고칠 때는 서버를 손으로 다시 띄워야 한다(자주 있는 일이 아님).
|
||||
# ⚠ 루트와 `config` 는 넣지 않는다 — uvicorn 은 준 폴더를 `rglob("*.py")` 로 **재귀**로
|
||||
# 훑는다. 루트를 주면 storage·venv(파이썬 파일만 7,530개)를 도로 다 훑고, `config` 안에는
|
||||
# `node_modules` 가 들어 있어 역시 무겁다. 그 대신 **`main.py` 와 `config/` 를 고칠 때는
|
||||
# 서버를 손으로 다시 띄울 것** (둘 다 자주 고치는 자리가 아니다).
|
||||
watched: 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 # 의존성 트리가 안에 있으면 훑는 값이 이득을 넘는다
|
||||
if any(entry.rglob("*.py")):
|
||||
watched.append(str(entry))
|
||||
return watched
|
||||
|
||||
Reference in New Issue
Block a user