1
This commit is contained in:
@@ -321,6 +321,34 @@ public class TencentDocDelayedPushServiceImpl implements ITencentDocDelayedPushS
|
|||||||
|
|
||||||
log.info("✓ 批量同步执行完成,结果: {}", result);
|
log.info("✓ 批量同步执行完成,结果: {}", result);
|
||||||
|
|
||||||
|
// 将接口返回的 nextStartRow 写回 Redis,下次定时执行从新起始行开始(否则会一直从配置的 99 开始)
|
||||||
|
if (result instanceof java.util.Map) {
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
java.util.Map<String, Object> resultMap = (java.util.Map<String, Object>) result;
|
||||||
|
Object data = resultMap.get("data");
|
||||||
|
if (data instanceof java.util.Map) {
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
java.util.Map<String, Object> dataMap = (java.util.Map<String, Object>) data;
|
||||||
|
Object nextStartRowObj = dataMap.get("nextStartRow");
|
||||||
|
if (nextStartRowObj != null) {
|
||||||
|
int nextStartRow;
|
||||||
|
if (nextStartRowObj instanceof Number) {
|
||||||
|
nextStartRow = ((Number) nextStartRowObj).intValue();
|
||||||
|
} else {
|
||||||
|
try {
|
||||||
|
nextStartRow = Integer.parseInt(nextStartRowObj.toString());
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
nextStartRow = -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (nextStartRow >= 1) {
|
||||||
|
redisCache.setCacheObject(CONFIG_KEY_PREFIX + "startRow", nextStartRow, 180, TimeUnit.DAYS);
|
||||||
|
log.info("✓ 已更新下次起始行到 Redis: startRow={}(下次定时同步从第 {} 行开始)", nextStartRow, nextStartRow);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
log.error("批量同步调用失败", ex);
|
log.error("批量同步调用失败", ex);
|
||||||
if (batchId != null) {
|
if (batchId != null) {
|
||||||
|
|||||||
Reference in New Issue
Block a user