fix bug
加锁还是那个问题,连接期间过于复杂
This commit is contained in:
parent
8d7d63f1bb
commit
356a59d54a
@ -159,7 +159,7 @@ class BaseDanmu():
|
||||
async with self.lock_for_reseting_roomid_manually:
|
||||
# not None是判断是否已经连接了的(重连过程中也可以处理)
|
||||
if self.ws is not None:
|
||||
await self.close()
|
||||
await self.close_ws()
|
||||
if self.task_main is not None:
|
||||
await self.task_main
|
||||
# 由于锁的存在,绝对不可能到达下一个的自动重连状态,这里是保证正确显示当前监控房间号
|
||||
@ -169,7 +169,9 @@ class BaseDanmu():
|
||||
async def close(self):
|
||||
if not self._closed:
|
||||
self._closed = True
|
||||
await self.close_ws()
|
||||
async with self.lock_for_reseting_roomid_manually:
|
||||
if self.ws is not None:
|
||||
await self.close_ws()
|
||||
if self._waiting is not None:
|
||||
await self._waiting
|
||||
return True
|
||||
|
Loading…
Reference in New Issue
Block a user