Use IPv4-only WSGI start up as a fallback only when the IPv6/IPv4 one didn't work
This commit is contained in:
parent
a75c393922
commit
b8b88183c3
2
cps.py
2
cps.py
|
@ -30,7 +30,7 @@ if __name__ == '__main__':
|
||||||
else:
|
else:
|
||||||
web.app.logger.info('Falling back to Tornado')
|
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, '0.0.0.0')
|
http_server.listen(web.ub.config.config_port)
|
||||||
IOLoop.instance().start()
|
IOLoop.instance().start()
|
||||||
IOLoop.instance().close(True)
|
IOLoop.instance().close(True)
|
||||||
|
|
||||||
|
|
|
@ -3046,5 +3046,8 @@ def upload():
|
||||||
def start_gevent():
|
def start_gevent():
|
||||||
from gevent.wsgi import WSGIServer
|
from gevent.wsgi import WSGIServer
|
||||||
global gevent_server
|
global gevent_server
|
||||||
|
try:
|
||||||
|
gevent_server = WSGIServer(('', ub.config.config_port), app)
|
||||||
|
except socket.error:
|
||||||
gevent_server = WSGIServer(('0.0.0.0', ub.config.config_port), app)
|
gevent_server = WSGIServer(('0.0.0.0', ub.config.config_port), app)
|
||||||
gevent_server.serve_forever()
|
gevent_server.serve_forever()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user