From 39a3f70084d3c819eebc00e8dbdbf12938902474 Mon Sep 17 00:00:00 2001 From: Ozzieisaacs Date: Sun, 24 Mar 2019 15:22:41 +0100 Subject: [PATCH] Fix for slow updater --- cps/admin.py | 4 +++- cps/updater.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/cps/admin.py b/cps/admin.py index 4cf57f2d..552df575 100644 --- a/cps/admin.py +++ b/cps/admin.py @@ -758,12 +758,14 @@ def get_updater_status(): "11": _(u'Update failed:') + u' ' + _(u'General error') } 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, occurs after restart on update status['status'] = 7 diff --git a/cps/updater.py b/cps/updater.py index bee8e4cc..c0c21e9c 100644 --- a/cps/updater.py +++ b/cps/updater.py @@ -49,7 +49,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):