Skip to content

Commit efcd683

Browse files
committed
Untested draft based on discussion
1 parent 18d74ae commit efcd683

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

shiny/_main.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,13 @@ def run_app(
331331

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

334+
# Workaround for workbench issue 7368
335+
deflate_args: DeflateArgs = {}
336+
if (RS_SERVER_URL := os.getenv("RS_SERVER_URL")):
337+
deflate_args = {
338+
"ws_per_message_deflate": False,
339+
}
340+
334341
if reload_dirs is None:
335342
reload_dirs = []
336343
if app_dir is not None:
@@ -412,7 +419,7 @@ def run_app(
412419
# Don't allow shiny to use uvloop!
413420
# https://github.com/posit-dev/py-shiny/issues/1373
414421
loop="asyncio",
415-
ws_per_message_deflate=False, # Workaround for workbench issue 7368
422+
**deflate_args, # pyright: ignore[reportArgumentType]
416423
**reload_args, # pyright: ignore[reportArgumentType]
417424
**kwargs,
418425
)
@@ -713,6 +720,8 @@ class ReloadArgs(TypedDict):
713720
reload_excludes: NotRequired[list[str]]
714721
reload_dirs: NotRequired[list[str]]
715722

723+
class DeflateArgs(TypedDict):
724+
ws_per_message_deflate: NotRequired[bool]
716725

717726
# Check that the version of rsconnect supports Shiny Express; can be removed in the
718727
# future once this version of rsconnect is widely used. The dependency on "packaging"

0 commit comments

Comments
 (0)