mirror of
https://github.com/tiennm99/DocsGPT.git
synced 2026-10-15 18:15:33 +00:00
fix: refuse a busy mock LLM port before dev starts anything
The mock starts first and the API and worker are pointed at it, but only the API port was preflighted. A busy 8090 therefore showed up as a child exiting once the rest were running, or as the API talking to whatever else was on that port. --ui is deliberately left alone: vite.config.ts sets no strictPort, so Vite moves to the next free port rather than failing.
This commit is contained in:
1 parent
66fbb11049
commit
9e86dd4e94
2 files changed
+24
No files matched your search
@@ -739,6 +739,13 @@ def dev(args, context: Optional[Context] = None) -> int:
|
||||
f"port {args.port} is already in use, so the API cannot bind it. Stop what is on it "
|
||||
f"(a previous `docsgpt dev`, or `docsgpt down` for an install), or pass --port."
|
||||
)
|
||||
if getattr(args, "mock_llm", False) and not _port_is_free(dev_module.MOCK_LLM_PORT):
|
||||
# It starts first and the others are pointed at it, so a busy port here would surface as the
|
||||
# API talking to someone else's server, or as a child exiting once everything else is up.
|
||||
raise DeployError(
|
||||
f"port {dev_module.MOCK_LLM_PORT} is already in use, so the mock LLM cannot bind it. "
|
||||
"Stop what is on it, or leave --mock-llm off and point DocsGPT at a real provider."
|
||||
)
|
||||
children = dev_module.plan(args, checkout)
|
||||
print(f"DocsGPT from {checkout}")
|
||||
for child in children:
|
||||
|
||||
Reference in new issue
Block a user