a yet another method to restart webui

This commit is contained in:
AUTOMATIC
2023-06-03 09:59:56 +03:00
parent 9d953c0e03
commit 333e63c091
5 changed files with 38 additions and 15 deletions

View File

@@ -841,3 +841,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)