问题描述:
channels能正常启动,可是在启动的一段时间后,websocket无法连接,终端打印的信息为如下
>
> websocket Diconnect ...
> Application instance wait_for=._call_check_cancel() at D:\Python\Python36\Lib\asyncio\futures.py:403, ()]>> for connection took too long to shut down and was killed.
>
此时,channels中所有的websocket 接口无法再连接。这个错误是在程序启动一段时间后偶然发生,又是运行一整天也不会出现此情况。在stackoverflow上看到是在disconnect中加 raise StopConsumer(),可惜没有用,请教大家这种情况该如何解决?
我怀疑是win10的原因,明天试试在linux上运行试试