diff options
author | AUTOMATIC <16777216c@gmail.com> | 2023-06-03 09:59:56 +0300 |
---|---|---|
committer | AUTOMATIC <16777216c@gmail.com> | 2023-06-03 09:59:56 +0300 |
commit | 333e63c0911c148ea306d7b72580d5c6d2f2c41a (patch) | |
tree | 48c925dc4be95b8b50305b159db2e952d1e40d35 /modules/shared.py | |
parent | 9d953c0e039cce2c9d8318de9b79a09e243d3e45 (diff) |
a yet another method to restart webui
Diffstat (limited to 'modules/shared.py')
-rw-r--r-- | modules/shared.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/modules/shared.py b/modules/shared.py index 7025a754..c4c719ad 100644 --- a/modules/shared.py +++ b/modules/shared.py @@ -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)
|