fix: 消息订阅redis连接未关闭

pull/7597/head^2
xinwen 2022-02-08 14:11:45 +08:00 committed by Jiangjie.Bai
parent ed077910eb
commit 5cfd5afc7c
1 changed files with 2 additions and 0 deletions

View File

@ -50,6 +50,7 @@ class SiteMsgWebsocket(JsonWebsocketConsumer):
while not self.disconnected:
subscribe = new_site_msg_chan.subscribe()
self.subscribe = subscribe
for message in subscribe.listen():
if message['type'] != 'message':
continue
@ -67,4 +68,5 @@ class SiteMsgWebsocket(JsonWebsocketConsumer):
def disconnect(self, close_code):
self.disconnected = True
self.subscribe.close()
self.close()