From 2f30f4f69faa51058e191dcce24e69bd42ce8706 Mon Sep 17 00:00:00 2001 From: Philip Xu Date: Wed, 6 Jun 2018 17:43:57 -0400 Subject: [PATCH] Fixed #1231 - release resource no matter what (#1232) --- sanic/app.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sanic/app.py b/sanic/app.py index 06540088..ca50edc1 100644 --- a/sanic/app.py +++ b/sanic/app.py @@ -303,7 +303,8 @@ class Sanic: await fut except (CancelledError, ConnectionClosed): pass - self.websocket_tasks.remove(fut) + finally: + self.websocket_tasks.remove(fut) await ws.close() self.router.add(uri=uri, handler=websocket_handler,