Fix for updater

pull/121/head
Jack Darlington 8 years ago
parent 7d31abf920
commit 29462e2278

@ -341,6 +341,10 @@ class Updater(threading.Thread):
ub.session.close() ub.session.close()
ub.engine.dispose() ub.engine.dispose()
self.status=6 self.status=6
if web.gevent_server:
web.gevent_server.stop()
else:
# stop tornado server # stop tornado server
server = IOLoop.instance() server = IOLoop.instance()
server.add_callback(server.stop) server.add_callback(server.stop)

@ -198,6 +198,8 @@ mimetypes.add_type('image/vnd.djvu', '.djvu')
app = (Flask(__name__)) app = (Flask(__name__))
app.wsgi_app = ReverseProxied(app.wsgi_app) app.wsgi_app = ReverseProxied(app.wsgi_app)
gevent_server=None
formatter = logging.Formatter( formatter = logging.Formatter(
"[%(asctime)s] {%(pathname)s:%(lineno)d} %(levelname)s - %(message)s") "[%(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) 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 = [] book_in_shelfs = []
return render_title_template('detail.html', entry=db_book, cc=cc, title=db_book.title, return render_title_template('detail.html', entry=db_book, cc=cc, title=db_book.title,
books_shelfs=book_in_shelfs, ) 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…
Cancel
Save