Update the reload excludes for CLI run (#709)

This commit is contained in:
Wu Clan
2025-07-02 18:16:43 +08:00
committed by GitHub
parent 099880dd1c
commit aa2b76673f

View File

@ -4,6 +4,7 @@ import asyncio
import os import os
from dataclasses import dataclass from dataclasses import dataclass
from pathlib import Path
from typing import Annotated from typing import Annotated
import cappa import cappa
@ -39,7 +40,7 @@ def run(host: str, port: int, reload: bool, workers: int | None) -> None:
host=host, host=host,
port=port, port=port,
reload=not reload, reload=not reload,
reload_excludes=[os.path.abspath('../.venv' if 'backend' in os.getcwd() else '.venv')], reload_excludes=[os.path.abspath('.venv' if Path(Path.cwd() / '.venv').is_dir() else '../.venv')],
workers=workers, workers=workers,
) )