@@ -333,9 +333,6 @@ def run_app(
333333
334334 log_config : dict [str , Any ] = copy .deepcopy (uvicorn .config .LOGGING_CONFIG )
335335
336- # Workaround for nginx/uvicorn issue within Workbench
337- # https://github.com/rstudio/rstudio-pro/issues/7368#issuecomment-2918016088
338-
339336 if reload_dirs is None :
340337 reload_dirs = []
341338 if app_dir is not None :
@@ -404,16 +401,7 @@ def run_app(
404401
405402 maybe_setup_rsw_proxying (log_config )
406403
407- if is_workbench () and kwargs .get ("ws_per_message_deflate" ):
408- # Workaround for nginx/uvicorn issue within Workbench
409- # https://github.com/rstudio/rstudio-pro/issues/7368#issuecomment-2918016088
410- warnings .warn (
411- "Overwriting kwarg 'ws_per_message_deflate'=True to False to avoid breaking issue in Workbench" ,
412- stacklevel = 2 ,
413- )
414- kwargs ["ws_per_message_deflate" ] = False
415- elif is_workbench ():
416- kwargs ["ws_per_message_deflate" ] = False
404+ _set_workbench_kwargs (kwargs )
417405
418406 uvicorn .run ( # pyright: ignore[reportUnknownMemberType]
419407 app ,
@@ -729,6 +717,21 @@ class ReloadArgs(TypedDict):
729717 reload_dirs : NotRequired [list [str ]]
730718
731719
720+ def _set_workbench_kwargs (kwargs : dict [str , object ]) -> None :
721+ print (kwargs )
722+ if is_workbench ():
723+ print ("hit" )
724+ if kwargs .get ("ws_per_message_deflate" ):
725+ # Workaround for nginx/uvicorn issue within Workbench
726+ # https://github.com/rstudio/rstudio-pro/issues/7368#issuecomment-2918016088
727+ warnings .warn (
728+ "Overwriting kwarg `ws_per_message_deflate=True` to `False` to avoid breaking issue in Workbench" ,
729+ stacklevel = 2 ,
730+ )
731+ kwargs ["ws_per_message_deflate" ] = False
732+ print (kwargs )
733+
734+
732735# Check that the version of rsconnect supports Shiny Express; can be removed in the
733736# future once this version of rsconnect is widely used. The dependency on "packaging"
734737# can also be removed then, because it is only used here. (Added 2024-03)
0 commit comments