mirror of
https://github.com/vladmandic/automatic
synced 2026-09-19 09:14:35 +02:00
installer auto-restart on upgrade
Signed-off-by: vladmandic <mandic00@live.com>
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
now covers both ROCm on Windows and Linux
|
||||
see *main interface -> scripts -> rocm advanced config*
|
||||
- **Features**
|
||||
- installer auto-restart on upgrade
|
||||
- enhanced filename pattern processing
|
||||
allows for any *processing* property name (as defined in `modules/processing_class.py` and saved to `ui-config.json`)
|
||||
allows for any *settings* property name (as defined in `modules/ui_definitions.py` and saved to `config.json`)
|
||||
|
||||
+3
-2
@@ -352,9 +352,10 @@ def branch(folder=None):
|
||||
|
||||
|
||||
# restart process
|
||||
def restart():
|
||||
def restart(argv: list | None = None):
|
||||
argv = argv if isinstance(argv, list) else sys.argv
|
||||
log.critical('Restarting process...')
|
||||
os.execv(sys.executable, ['python'] + sys.argv)
|
||||
os.execv(sys.executable, ['python'] + argv)
|
||||
|
||||
|
||||
# update git repository
|
||||
|
||||
@@ -303,9 +303,18 @@ def main():
|
||||
get_custom_args()
|
||||
installer.update_wiki()
|
||||
|
||||
if args.upgrade:
|
||||
if installer.restart_required:
|
||||
log.warning('Installer: restarting now to apply upgrade...')
|
||||
if '--upgrade' in sys.argv:
|
||||
sys.argv.remove('--upgrade')
|
||||
if '--update' in sys.argv:
|
||||
sys.argv.remove('--update')
|
||||
installer.restart(sys.argv)
|
||||
else:
|
||||
log.debug('Installer: no modifications')
|
||||
|
||||
uv, instance = start_server(immediate=True, server=None)
|
||||
if installer.restart_required:
|
||||
log.warning('Restart is recommended due to packages updates...')
|
||||
t_server = time.time()
|
||||
t_monitor = time.time()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user