Make devserver verify that no servers are already running before starting them.
This commit is contained in:
@@ -13,6 +13,7 @@ from pathlib import Path
|
|||||||
sys.path.insert(0, str(Path(__file__).with_name("fastapi-vue")))
|
sys.path.insert(0, str(Path(__file__).with_name("fastapi-vue")))
|
||||||
from devutil import ( # type: ignore
|
from devutil import ( # type: ignore
|
||||||
ProcessGroup,
|
ProcessGroup,
|
||||||
|
check_ports_free,
|
||||||
logger,
|
logger,
|
||||||
ready,
|
ready,
|
||||||
setup_fastapi,
|
setup_fastapi,
|
||||||
@@ -36,7 +37,7 @@ async def run_devserver(frontend: str, backend: str) -> None:
|
|||||||
|
|
||||||
async with ProcessGroup() as pg:
|
async with ProcessGroup() as pg:
|
||||||
npm_i = await pg.spawn(*npm_install, cwd=front)
|
npm_i = await pg.spawn(*npm_install, cwd=front)
|
||||||
await asyncio.sleep(0.2) # reduce message overlap
|
await check_ports_free(viteurl, backurl)
|
||||||
await pg.spawn(
|
await pg.spawn(
|
||||||
*fastapi,
|
*fastapi,
|
||||||
"--reload",
|
"--reload",
|
||||||
|
|||||||
Reference in New Issue
Block a user