Skip to content

Commit 7c63cfa

Browse files
committed
✨ Add WebSocket options to the _run function
1 parent 3c26fc3 commit 7c63cfa

File tree

1 file changed

+6
-20
lines changed

1 file changed

+6
-20
lines changed

src/fastapi_cli/cli.py

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -248,27 +248,13 @@ def _run(
248248
proxy_headers=proxy_headers,
249249
forwarded_allow_ips=forwarded_allow_ips,
250250
log_config=get_uvicorn_log_config(),
251+
ws=ws.value,
252+
ws_max_size=ws_max_size,
253+
ws_max_queue=ws_max_queue,
254+
ws_ping_interval=ws_ping_interval,
255+
ws_ping_timeout=ws_ping_timeout,
256+
ws_per_message_deflate=ws_per_message_deflate,
251257
)
252-
print(Padding(panel, 1))
253-
if not uvicorn:
254-
raise FastAPICLIException(
255-
"Could not import Uvicorn, try running 'pip install uvicorn'"
256-
) from None
257-
uvicorn.run(
258-
app=use_uvicorn_app,
259-
host=host,
260-
port=port,
261-
reload=reload,
262-
workers=workers,
263-
root_path=root_path,
264-
proxy_headers=proxy_headers,
265-
ws=ws.value,
266-
ws_max_size=ws_max_size,
267-
ws_max_queue=ws_max_queue,
268-
ws_ping_interval=ws_ping_interval,
269-
ws_ping_timeout=ws_ping_timeout,
270-
ws_per_message_deflate=ws_per_message_deflate,
271-
)
272258

273259

274260
@app.command()

0 commit comments

Comments
 (0)