mirror of
https://github.com/fastapi-practices/fastapi_best_architecture.git
synced 2025-08-26 13:26:04 +08:00
Update the reload excludes for CLI run (#709)
This commit is contained in:
@ -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,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user