Fix for updater
This commit is contained in:
parent
7d31abf920
commit
29462e2278
|
@ -341,9 +341,13 @@ class Updater(threading.Thread):
|
|||
ub.session.close()
|
||||
ub.engine.dispose()
|
||||
self.status=6
|
||||
# stop tornado server
|
||||
server = IOLoop.instance()
|
||||
server.add_callback(server.stop)
|
||||
|
||||
if web.gevent_server:
|
||||
web.gevent_server.stop()
|
||||
else:
|
||||
# stop tornado server
|
||||
server = IOLoop.instance()
|
||||
server.add_callback(server.stop)
|
||||
self.status=7
|
||||
|
||||
def get_update_status(self):
|
||||
|
|
|
@ -198,6 +198,8 @@ mimetypes.add_type('image/vnd.djvu', '.djvu')
|
|||
app = (Flask(__name__))
|
||||
app.wsgi_app = ReverseProxied(app.wsgi_app)
|
||||
|
||||
gevent_server=None
|
||||
|
||||
formatter = logging.Formatter(
|
||||
"[%(asctime)s] {%(pathname)s:%(lineno)d} %(levelname)s - %(message)s")
|
||||
file_handler = RotatingFileHandler(os.path.join(config.get_main_dir, "calibre-web.log"), maxBytes=50000, backupCount=2)
|
||||
|
@ -2683,3 +2685,9 @@ def upload():
|
|||
book_in_shelfs = []
|
||||
return render_title_template('detail.html', entry=db_book, cc=cc, title=db_book.title,
|
||||
books_shelfs=book_in_shelfs, )
|
||||
|
||||
def start_gevent():
|
||||
from gevent.wsgi import WSGIServer
|
||||
global gevent_server
|
||||
gevent_server = WSGIServer(('', ub.config.config_port), app)
|
||||
gevent_server.serve_forever()
|
Loading…
Reference in New Issue
Block a user