浏览代码

alternative solution to #13434

AUTOMATIC1111 1 年之前
父节点
当前提交
ad3b8a1c41
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      modules/restart.py

+ 3 - 1
modules/restart.py

@@ -14,7 +14,9 @@ def is_restartable() -> bool:
 def restart_program() -> None:
     """creates file tmp/restart and immediately stops the process, which webui.bat/webui.sh interpret as a command to start webui again"""
 
-    (Path(script_path) / "tmp" / "restart").touch()
+    tmpdir = Path(script_path) / "tmp"
+    tmpdir.mkdir(parents=True, exist_ok=True)
+    (tmpdir / "restart").touch()
 
     stop_program()