1
0
Fork 0
mirror of https://github.com/morpheus65535/bazarr synced 2024-12-26 17:47:20 +00:00

Fix for restart after update from source on github.

This commit is contained in:
Louis Vézina 2019-11-21 21:30:06 -05:00
parent a9bf2ee8e4
commit 03e98fdb95

View file

@ -4,6 +4,7 @@ import logging
import json import json
import requests import requests
import tarfile import tarfile
import sys
from get_args import args from get_args import args
from config import settings from config import settings
@ -294,10 +295,14 @@ def request_json(url, **kwargs):
def updated(restart=True): def updated(restart=True):
if settings.general.getboolean('update_restart') and restart: if settings.general.getboolean('update_restart') and restart:
try: try:
from main import restart database.close()
restart() restart_file = open(os.path.join(args.config_dir, "bazarr.restart"), "w")
except: logging.info('Bazarr is being restarted...')
logging.info('BAZARR Restart failed, please restart Bazarr manualy') restart_file.write('')
restart_file.close()
sys.exit(0)
except Exception as e:
logging.info('BAZARR Restart failed, please restart Bazarr manually')
updated(restart=False) updated(restart=False)
else: else:
database.execute("UPDATE system SET updated='1'") database.execute("UPDATE system SET updated='1'")