mirror of
https://github.com/janeczku/calibre-web
synced 2025-01-12 02:10:30 +00:00
Fix for gevent as optional
This commit is contained in:
parent
06a4af44cc
commit
b352bbfd14
9
cps.py
9
cps.py
@ -20,10 +20,11 @@ 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:
|
||||||
if len(sys.argv) > 1 and sys.argv[1] == '-g':
|
try:
|
||||||
http_server = WSGIServer(('', web.ub.config.config_port), web.app)
|
web.app.logger.info('Attempting to start gevent')
|
||||||
http_server.serve_forever()
|
web.start_gevent()
|
||||||
else:
|
except ImportError:
|
||||||
|
web.app.logger.info('Falling back to Tornado')
|
||||||
http_server = HTTPServer(WSGIContainer(web.app))
|
http_server = HTTPServer(WSGIContainer(web.app))
|
||||||
http_server.listen(web.ub.config.config_port)
|
http_server.listen(web.ub.config.config_port)
|
||||||
IOLoop.instance().start()
|
IOLoop.instance().start()
|
||||||
|
@ -315,7 +315,7 @@ class Config:
|
|||||||
else:
|
else:
|
||||||
self.config_google_drive_watch_changes_response=None
|
self.config_google_drive_watch_changes_response=None
|
||||||
self.config_columns_to_ignore = data.config_columns_to_ignore
|
self.config_columns_to_ignore = data.config_columns_to_ignore
|
||||||
if (self.config_calibre_dir is not None and not self.config_use_google_drive) or os.path.exists(self.config_calibre_dir + '/metadata.db'):
|
if self.config_calibre_dir is not None and (not self.config_use_google_drive or os.path.exists(self.config_calibre_dir + '/metadata.db')):
|
||||||
self.db_configured = True
|
self.db_configured = True
|
||||||
else:
|
else:
|
||||||
self.db_configured = False
|
self.db_configured = False
|
||||||
|
Loading…
Reference in New Issue
Block a user