File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -338,14 +338,25 @@ def _run(
338338
339339 _run_dev (running_mode , frontend_port , backend_port , backend_host )
340340 else :
341- port = (
342- frontend_port or backend_port or config .frontend_port or config .backend_port
343- )
341+ if running_mode == constants .RunningMode .BACKEND_ONLY :
342+ requested_port = backend_port or config .backend_port
343+ fallback_port = constants .DefaultPorts .BACKEND_PORT
344+ elif running_mode == constants .RunningMode .FRONTEND_ONLY :
345+ requested_port = frontend_port or config .frontend_port
346+ fallback_port = constants .DefaultPorts .FRONTEND_PORT
347+ else :
348+ requested_port = (
349+ frontend_port
350+ or backend_port
351+ or config .frontend_port
352+ or config .backend_port
353+ )
354+ fallback_port = constants .DefaultPorts .FRONTEND_PORT
344355
345356 port = processes .handle_port (
346357 service_name = running_mode .name .lower (),
347- port = ( port or constants . DefaultPorts . FRONTEND_PORT ) ,
348- auto_increment = port is None ,
358+ port = requested_port or fallback_port ,
359+ auto_increment = requested_port is None ,
349360 )
350361
351362 _run_prod (running_mode , port , backend_host )
You can’t perform that action at this time.
0 commit comments