mirror of
https://github.com/janeczku/calibre-web
synced 2024-10-31 15:16:20 +00:00
Updated to use “gevent” so can use yield to download books
This commit is contained in:
parent
cf1ca21bbc
commit
4b59eab3eb
11
cps.py
11
cps.py
@ -14,14 +14,19 @@ from cps import web
|
|||||||
from tornado.wsgi import WSGIContainer
|
from tornado.wsgi import WSGIContainer
|
||||||
from tornado.httpserver import HTTPServer
|
from tornado.httpserver import HTTPServer
|
||||||
from tornado.ioloop import IOLoop
|
from tornado.ioloop import IOLoop
|
||||||
|
from gevent.wsgi import WSGIServer
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
if web.ub.DEVELOPMENT:
|
if web.ub.DEVELOPMENT:
|
||||||
web.app.run(host="0.0.0.0", port=web.ub.config.config_port, debug=True)
|
web.app.run(host="0.0.0.0", port=web.ub.config.config_port, debug=True)
|
||||||
else:
|
else:
|
||||||
http_server = HTTPServer(WSGIContainer(web.app))
|
if len(sys.argv) > 1 and sys.argv[1] == '-g':
|
||||||
http_server.listen(web.ub.config.config_port)
|
http_server = WSGIServer(('', web.ub.config.config_port), web.app)
|
||||||
IOLoop.instance().start()
|
http_server.serve_forever()
|
||||||
|
else:
|
||||||
|
http_server = HTTPServer(WSGIContainer(web.app))
|
||||||
|
http_server.listen(web.ub.config.config_port)
|
||||||
|
IOLoop.instance().start()
|
||||||
|
|
||||||
if web.helper.global_task == 0:
|
if web.helper.global_task == 0:
|
||||||
web.app.logger.info("Performing restart of Calibre-web")
|
web.app.logger.info("Performing restart of Calibre-web")
|
||||||
|
Loading…
Reference in New Issue
Block a user