Browse Source

raise exception when trying to run with multiple workers (fixes #2055)

Falko Schindler 1 year ago
parent
commit
fe909072b3
1 changed files with 3 additions and 0 deletions
  1. 3 0
      nicegui/ui_run.py

+ 3 - 0
nicegui/ui_run.py

@@ -138,6 +138,9 @@ def run(*,
     def split_args(args: str) -> List[str]:
     def split_args(args: str) -> List[str]:
         return [a.strip() for a in args.split(',')]
         return [a.strip() for a in args.split(',')]
 
 
+    if kwargs.get('workers', 1) > 1:
+        raise ValueError('NiceGUI does not support multiple workers yet.')
+
     # NOTE: The following lines are basically a copy of `uvicorn.run`, but keep a reference to the `server`.
     # NOTE: The following lines are basically a copy of `uvicorn.run`, but keep a reference to the `server`.
 
 
     config = CustomServerConfig(
     config = CustomServerConfig(