fix: es 返回空数据
This commit is contained in:
@@ -58,6 +58,9 @@ async def fetch(interval: ESInterval, size=1000) -> AsyncIterable[dict]:
|
|||||||
return
|
return
|
||||||
|
|
||||||
docs = es_response["data"]["docs"]
|
docs = es_response["data"]["docs"]
|
||||||
|
if not docs:
|
||||||
|
print("未获取到数据")
|
||||||
|
return
|
||||||
print(
|
print(
|
||||||
f'用时 {int(duration)} 秒,获取到 {len(docs)} 条数据,最早时间 {parse_unixtime(docs[0]["crawled_at"])},最晚时间 {parse_unixtime(docs[-1]["crawled_at"])}'
|
f'用时 {int(duration)} 秒,获取到 {len(docs)} 条数据,最早时间 {parse_unixtime(docs[0]["crawled_at"])},最晚时间 {parse_unixtime(docs[-1]["crawled_at"])}'
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user