我在控制台日志中收到此错误,并且在提交表单时它不断加载不会将数据发布到服务器。
/home/Python/Working/Benutzerverwaltung/env/lib/python3.6/site-packages/channels/sessions.py:183> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x7fab9fe51408>()]>> for connection <WebSocketProtocol client=['127.0.0.1', 59462] path=b'/ws/stream/Sales'> took too long to shut down and was killed.
这是我关闭频道的代码。
async def disconnect(self, code):
async_to_sync(self.channel_layer.group_discard)(
self.room_group_name,
self.channel
)
await self.close()
async def websocket_disconnect(self, event):
print("Disconnect", event)
await self.send({
"type": "websocket.close"
})
如何解决这个问题?