chart
This commit is contained in:
@@ -479,8 +479,23 @@ export async function main(
|
||||
.toArray();
|
||||
|
||||
if (records.length === 0) {
|
||||
logWithTimestamp(`第 ${page+1} 批次没有找到数据,结束处理`);
|
||||
break;
|
||||
logWithTimestamp(`第 ${page+1} 批次没有找到数据,但将继续尝试后续批次...`);
|
||||
|
||||
// 更新查询条件,以确保能找到后续数据
|
||||
// 更新查询时间,增加一定的时间窗口以尝试找到后续数据
|
||||
const timeGap = 3600 * 1000; // 1小时的毫秒数
|
||||
lastCreateTime += timeGap;
|
||||
|
||||
query.createTime = { $gt: lastCreateTime };
|
||||
if (lastId) {
|
||||
// 移除ID条件,因为我们已经跳过了时间
|
||||
delete query._id;
|
||||
}
|
||||
|
||||
logWithTimestamp(`调整查询条件向前搜索: 创建时间 > ${new Date(lastCreateTime).toISOString()}`);
|
||||
|
||||
// 继续下一批次,不中断循环
|
||||
continue;
|
||||
}
|
||||
|
||||
logWithTimestamp(`获取到 ${records.length} 条记录,开始处理...`);
|
||||
|
||||
Reference in New Issue
Block a user