aboutsummaryrefslogtreecommitdiff
path: root/modules/shared.py
diff options
context:
space:
mode:
authorAUTOMATIC1111 <16777216c@gmail.com>2023-06-04 11:17:20 +0300
committerGitHub <noreply@github.com>2023-06-04 11:17:20 +0300
commit0819383de05e57ec5da638bd4d5d180b5bac981a (patch)
treeecec2c764772b337167248382fd7b72cdcef3209 /modules/shared.py
parentefc4c79b5ecd0bfff09b5f7bb9acf4b9044207ae (diff)
parent333e63c0911c148ea306d7b72580d5c6d2f2c41a (diff)
Merge pull request #10975 from AUTOMATIC1111/restart3
A yet another method to restart webui.
Diffstat (limited to 'modules/shared.py')
-rw-r--r--modules/shared.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/modules/shared.py b/modules/shared.py
index 53e3d5da..7d056a4d 100644
--- a/modules/shared.py
+++ b/modules/shared.py
@@ -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)