Merge pull request #10975 from AUTOMATIC1111/restart3

A yet another method to restart webui.
This commit is contained in:
AUTOMATIC1111
2023-06-04 11:17:20 +03:00
committed by GitHub
5 changed files with 38 additions and 15 deletions

View File

@@ -852,3 +852,12 @@ def walk_files(path, allowed_extensions=None):
continue
yield os.path.join(root, filename)
def restart_program():
"""creates file tmp/restart and immediately stops the process, which webui.bat/webui.sh interpret as a command to start webui again"""
with open(os.path.join(script_path, "tmp", "restart"), "w"):
pass
os._exit(0)