Bläddra i källkod

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

Falko Schindler 1 år sedan
förälder
incheckning
fe909072b3
1 ändrade filer med 3 tillägg och 0 borttagningar
  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]:
         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`.
 
     config = CustomServerConfig(