mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-16 02:02:58 -07:00
Restart Tautulli process if Windows installer failed
This commit is contained in:
parent
7641e3b081
commit
a029d6a931
1 changed files with 9 additions and 7 deletions
|
@ -141,27 +141,29 @@ def update_tautulli():
|
||||||
logger.info('Running %s', download_file)
|
logger.info('Running %s', download_file)
|
||||||
try:
|
try:
|
||||||
subprocess.call([file_path, '/S', '/NORUN'], creationflags=CREATE_NO_WINDOW)
|
subprocess.call([file_path, '/S', '/NORUN'], creationflags=CREATE_NO_WINDOW)
|
||||||
|
status = 0
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.exception('Failed to install Tautulli: %s', e)
|
logger.exception('Failed to install Tautulli: %s', e)
|
||||||
return -1
|
status = -1
|
||||||
|
|
||||||
logger.info('Tautulli updated to %s', version)
|
if status == 0:
|
||||||
|
logger.info('Tautulli updated to %s', version)
|
||||||
|
|
||||||
logger.info('Restarting Tautulli processes')
|
logger.info('Restarting Tautulli processes')
|
||||||
for process in processes:
|
for process in processes:
|
||||||
logger.info('Starting process: %s', process)
|
logger.info('Starting process: %s', process)
|
||||||
subprocess.Popen(process, creationflags=CREATE_NO_WINDOW)
|
subprocess.Popen(process, creationflags=CREATE_NO_WINDOW)
|
||||||
|
|
||||||
return 0
|
return status
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
logger = init_logger()
|
logger = init_logger()
|
||||||
|
|
||||||
try:
|
try:
|
||||||
status = update_tautulli()
|
status_code = update_tautulli()
|
||||||
except Exception as exc:
|
except Exception as exc:
|
||||||
status = exc
|
status_code = exc
|
||||||
logger.debug('Update function returned status code %s', status)
|
logger.debug('Update function returned status code %s', status_code)
|
||||||
|
|
||||||
sys.exit(status)
|
sys.exit(status_code)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue