diff --git a/cps/updater.py b/cps/updater.py index 1e0b8115..f1c0b95f 100644 --- a/cps/updater.py +++ b/cps/updater.py @@ -51,7 +51,7 @@ class Updater(threading.Thread): def __init__(self): threading.Thread.__init__(self) - self.status = 0 + self.status = -1 self.updateIndex = None def get_current_version_info(self): diff --git a/cps/web.py b/cps/web.py index cd8abf1e..b9cd867c 100644 --- a/cps/web.py +++ b/cps/web.py @@ -1192,16 +1192,20 @@ def get_updater_status(): } status['text'] = text # helper.updater_thread = helper.Updater() + updater_thread.status = 0 updater_thread.start() status['status'] = updater_thread.get_update_status() elif request.method == "GET": try: status['status'] = updater_thread.get_update_status() + if status['status'] == -1: + status['status'] = 7 except AttributeError: # thread is not active, occours after restart on update status['status'] = 7 except Exception: status['status'] = 11 + app.logger.error(status['status']) return json.dumps(status)