fix: Fixed exception caused by abnormal api response in dynamic push
This commit is contained in:
@@ -49,7 +49,7 @@ async def dynamic_spider(datasource: DataSource):
|
|||||||
if latest_dynamic is None:
|
if latest_dynamic is None:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if "new_num" not in latest_dynamic:
|
if "new_num" not in latest_dynamic or "cards" not in latest_dynamic:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
new_num = latest_dynamic["new_num"]
|
new_num = latest_dynamic["new_num"]
|
||||||
|
|||||||
@@ -73,7 +73,8 @@ class Up(BaseModel):
|
|||||||
return 6 if not self.__room else self.__room.get_status()
|
return 6 if not self.__room else self.__room.get_status()
|
||||||
|
|
||||||
def dispatch(self, event, data):
|
def dispatch(self, event, data):
|
||||||
self.__room.dispatch(event, data)
|
if self.__room is not None:
|
||||||
|
self.__room.dispatch(event, data)
|
||||||
|
|
||||||
def inject_bot(self, bot):
|
def inject_bot(self, bot):
|
||||||
self.__bot = bot
|
self.__bot = bot
|
||||||
@@ -179,7 +180,6 @@ class Up(BaseModel):
|
|||||||
开播事件
|
开播事件
|
||||||
"""
|
"""
|
||||||
logger.debug(f"{self.uname} (LIVE): {event}")
|
logger.debug(f"{self.uname} (LIVE): {event}")
|
||||||
# logger.warning(f"{self.uname}: 开播事件")
|
|
||||||
|
|
||||||
locked = False
|
locked = False
|
||||||
room_info = {}
|
room_info = {}
|
||||||
@@ -255,7 +255,6 @@ class Up(BaseModel):
|
|||||||
下播事件
|
下播事件
|
||||||
"""
|
"""
|
||||||
logger.debug(f"{self.uname} (PREPARING): {event}")
|
logger.debug(f"{self.uname} (PREPARING): {event}")
|
||||||
# logger.warning(f"{self.uname}: 下播事件")
|
|
||||||
|
|
||||||
if await redis.get_live_status(self.room_id) == 0:
|
if await redis.get_live_status(self.room_id) == 0:
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user