Skip to content
Merged
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions shiny/_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,14 @@ def run_app(

log_config: dict[str, Any] = copy.deepcopy(uvicorn.config.LOGGING_CONFIG)

# Workaround for nginx/uvicorn issue within Workbench
# https://github.com/rstudio/rstudio-pro/issues/7368#issuecomment-2918016088
deflate_args: DeflateArgs = {}
if is_workbench():
deflate_args = {
"ws_per_message_deflate": False,
}

if reload_dirs is None:
reload_dirs = []
if app_dir is not None:
Expand Down Expand Up @@ -412,6 +420,7 @@ def run_app(
# Don't allow shiny to use uvloop!
# https://github.com/posit-dev/py-shiny/issues/1373
loop="asyncio",
**deflate_args, # pyright: ignore[reportArgumentType]
**reload_args, # pyright: ignore[reportArgumentType]
**kwargs,
)
Expand Down Expand Up @@ -713,6 +722,10 @@ class ReloadArgs(TypedDict):
reload_dirs: NotRequired[list[str]]


class DeflateArgs(TypedDict):
ws_per_message_deflate: NotRequired[bool]


# Check that the version of rsconnect supports Shiny Express; can be removed in the
# future once this version of rsconnect is widely used. The dependency on "packaging"
# can also be removed then, because it is only used here. (Added 2024-03)
Expand Down
Loading