adopt new websockets interface

This commit is contained in:
Yun Xu 2017-11-25 21:01:22 -08:00
parent 472bbcf293
commit f09c0393ba
2 changed files with 2 additions and 2 deletions

View File

@ -635,7 +635,7 @@ def serve(host, port, request_handler, error_handler, before_start=None,
coros = []
for conn in connections:
if hasattr(conn, "websocket") and conn.websocket:
coros.append(conn.websocket.close_connection(force=True))
coros.append(conn.websocket.close_connection(after_handshake=True))
else:
conn.close()

View File

@ -115,7 +115,7 @@ class GunicornWorker(base.Worker):
coros = []
for conn in self.connections:
if hasattr(conn, "websocket") and conn.websocket:
coros.append(conn.websocket.close_connection(force=True))
coros.append(conn.websocket.close_connection(after_handshake=False))
else:
conn.close()
_shutdown = asyncio.gather(*coros, loop=self.loop)