浏览代码

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

Falko Schindler 1 年之前
父节点
当前提交
fe909072b3
共有 1 个文件被更改,包括 3 次插入0 次删除
  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(