Skip to content

Commit

Permalink
fix[docs]: specify units and defaults for ws_* args in docs (#2153)
Browse files Browse the repository at this point in the history
Co-authored-by: Marcelo Trylesinski <[email protected]>
  • Loading branch information
ryan-mccaffrey and Kludex authored Nov 16, 2023
1 parent 94593f3 commit dc205af
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
6 changes: 4 additions & 2 deletions docs/deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,10 @@ Options:
[default: 16777216]
--ws-max-queue INTEGER The maximum length of the WebSocket message
queue. [default: 32]
--ws-ping-interval FLOAT WebSocket ping interval [default: 20.0]
--ws-ping-timeout FLOAT WebSocket ping timeout [default: 20.0]
--ws-ping-interval FLOAT WebSocket ping interval in seconds.
[default: 20.0]
--ws-ping-timeout FLOAT WebSocket ping timeout in seconds.
[default: 20.0]
--ws-per-message-deflate BOOLEAN
WebSocket per-message-deflate compression
[default: True]
Expand Down
6 changes: 4 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,10 @@ Options:
[default: 16777216]
--ws-max-queue INTEGER The maximum length of the WebSocket message
queue. [default: 32]
--ws-ping-interval FLOAT WebSocket ping interval [default: 20.0]
--ws-ping-timeout FLOAT WebSocket ping timeout [default: 20.0]
--ws-ping-interval FLOAT WebSocket ping interval in seconds.
[default: 20.0]
--ws-ping-timeout FLOAT WebSocket ping timeout in seconds.
[default: 20.0]
--ws-per-message-deflate BOOLEAN
WebSocket per-message-deflate compression
[default: True]
Expand Down
4 changes: 2 additions & 2 deletions docs/settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ Using Uvicorn with watchfiles will enable the following options (which are other
* `--ws <str>` - Set the WebSockets protocol implementation. Either of the `websockets` and `wsproto` packages are supported. Use `'none'` to ignore all websocket requests. **Options:** *'auto', 'none', 'websockets', 'wsproto'.* **Default:** *'auto'*.
* `--ws-max-size <int>` - Set the WebSockets max message size, in bytes. Please note that this can be used only with the default `websockets` protocol.
* `--ws-max-queue <int>` - Set the maximum length of the WebSocket incoming message queue. Please note that this can be used only with the default `websockets` protocol.
* `--ws-ping-interval <float>` - Set the WebSockets ping interval, in seconds. Please note that this can be used only with the default `websockets` protocol.
* `--ws-ping-timeout <float>` - Set the WebSockets ping timeout, in seconds. Please note that this can be used only with the default `websockets` protocol.
* `--ws-ping-interval <float>` - Set the WebSockets ping interval, in seconds. Please note that this can be used only with the default `websockets` protocol. **Default:** *20.0*
* `--ws-ping-timeout <float>` - Set the WebSockets ping timeout, in seconds. Please note that this can be used only with the default `websockets` protocol. **Default:** *20.0*
* `--lifespan <str>` - Set the Lifespan protocol implementation. **Options:** *'auto', 'on', 'off'.* **Default:** *'auto'*.
* `--h11-max-incomplete-event-size <int>` - Set the maximum number of bytes to buffer of an incomplete event. Only available for `h11` HTTP protocol implementation. **Default:** *'16384'* (16 KB).

Expand Down
4 changes: 2 additions & 2 deletions uvicorn/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,14 +156,14 @@ def print_version(ctx: click.Context, param: click.Parameter, value: bool) -> No
"--ws-ping-interval",
type=float,
default=20.0,
help="WebSocket ping interval",
help="WebSocket ping interval in seconds.",
show_default=True,
)
@click.option(
"--ws-ping-timeout",
type=float,
default=20.0,
help="WebSocket ping timeout",
help="WebSocket ping timeout in seconds.",
show_default=True,
)
@click.option(
Expand Down

0 comments on commit dc205af

Please sign in to comment.