mirror of
https://github.com/JonathanHerrewijnen/calibre-web.git
synced 2024-11-10 21:24:15 +00:00
Updater fix for slow servers
This commit is contained in:
parent
fa36072699
commit
843a93fe28
@ -51,7 +51,7 @@ class Updater(threading.Thread):
|
|||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
threading.Thread.__init__(self)
|
threading.Thread.__init__(self)
|
||||||
self.status = 0
|
self.status = -1
|
||||||
self.updateIndex = None
|
self.updateIndex = None
|
||||||
|
|
||||||
def get_current_version_info(self):
|
def get_current_version_info(self):
|
||||||
|
@ -1192,16 +1192,20 @@ def get_updater_status():
|
|||||||
}
|
}
|
||||||
status['text'] = text
|
status['text'] = text
|
||||||
# helper.updater_thread = helper.Updater()
|
# helper.updater_thread = helper.Updater()
|
||||||
|
updater_thread.status = 0
|
||||||
updater_thread.start()
|
updater_thread.start()
|
||||||
status['status'] = updater_thread.get_update_status()
|
status['status'] = updater_thread.get_update_status()
|
||||||
elif request.method == "GET":
|
elif request.method == "GET":
|
||||||
try:
|
try:
|
||||||
status['status'] = updater_thread.get_update_status()
|
status['status'] = updater_thread.get_update_status()
|
||||||
|
if status['status'] == -1:
|
||||||
|
status['status'] = 7
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
# thread is not active, occours after restart on update
|
# thread is not active, occours after restart on update
|
||||||
status['status'] = 7
|
status['status'] = 7
|
||||||
except Exception:
|
except Exception:
|
||||||
status['status'] = 11
|
status['status'] = 11
|
||||||
|
app.logger.error(status['status'])
|
||||||
return json.dumps(status)
|
return json.dumps(status)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user