fix: 修改视频列表获取逻辑,支持级别 2 的请求以增加最大页数和限制
This commit is contained in:
parent
cf74282459
commit
7f60997a58
20
DB.py
20
DB.py
@ -268,3 +268,23 @@ class DBVidcon:
|
||||
else:
|
||||
break
|
||||
return proxy
|
||||
|
||||
def queues_empty(self) -> bool:
|
||||
"""
|
||||
判断 urgent_list_key 和 list_key 两个队列是否都为空。
|
||||
如果都空,返回 True;只要有一个不空,就返回 False。
|
||||
"""
|
||||
# 注意:redis.llen 返回 int
|
||||
return (
|
||||
self.redis.llen(self.urgent_list_key) == 0
|
||||
and self.redis.llen(self.list_key) == 0
|
||||
)
|
||||
|
||||
def pop_error_item(self):
|
||||
"""
|
||||
从 error_list_key 中弹出一个错误记录(lpop),
|
||||
如果队列为空,返回 None。
|
||||
"""
|
||||
item = self.redis.lpop(self.error_list_key)
|
||||
# 如果你存入的是 JSON 字符串,可以在这里做一次反序列化:
|
||||
return json.loads(item) if item is not None else None
|
||||
|
Loading…
x
Reference in New Issue
Block a user