1
This commit is contained in:
@@ -96,9 +96,11 @@ public class TencentDocConfigController extends BaseController {
|
|||||||
config.put("apiBaseUrl", tencentDocConfig.getApiBaseUrl());
|
config.put("apiBaseUrl", tencentDocConfig.getApiBaseUrl());
|
||||||
|
|
||||||
// 获取当前同步进度(如果有配置)
|
// 获取当前同步进度(如果有配置)
|
||||||
|
// 注意:使用与 TencentDocController 相同的 Redis key 前缀
|
||||||
if (fileId != null && !fileId.isEmpty() && sheetId != null && !sheetId.isEmpty()) {
|
if (fileId != null && !fileId.isEmpty() && sheetId != null && !sheetId.isEmpty()) {
|
||||||
String syncProgressKey = "tencent:doc:sync:last_row:" + fileId + ":" + sheetId;
|
String syncProgressKey = "tendoc:last_row:" + fileId + ":" + sheetId;
|
||||||
Integer currentProgress = redisCache.getCacheObject(syncProgressKey);
|
Integer currentProgress = redisCache.getCacheObject(syncProgressKey);
|
||||||
|
log.debug("读取同步进度 - key: {}, value: {}", syncProgressKey, currentProgress);
|
||||||
if (currentProgress != null) {
|
if (currentProgress != null) {
|
||||||
config.put("currentProgress", currentProgress);
|
config.put("currentProgress", currentProgress);
|
||||||
|
|
||||||
@@ -208,11 +210,12 @@ public class TencentDocConfigController extends BaseController {
|
|||||||
redisCache.setCacheObject(REDIS_KEY_PREFIX + "startRow", startRow, 180, TimeUnit.DAYS);
|
redisCache.setCacheObject(REDIS_KEY_PREFIX + "startRow", startRow, 180, TimeUnit.DAYS);
|
||||||
|
|
||||||
// 清除该文档的同步进度(配置更新时重置进度,从新的startRow重新开始)
|
// 清除该文档的同步进度(配置更新时重置进度,从新的startRow重新开始)
|
||||||
String syncProgressKey = "tencent:doc:sync:last_row:" + fileId.trim() + ":" + sheetId.trim();
|
// 注意:使用与 TencentDocController 相同的 Redis key 前缀
|
||||||
|
String syncProgressKey = "tendoc:last_row:" + fileId.trim() + ":" + sheetId.trim();
|
||||||
String configVersionKey = "tencent:doc:sync:config_version:" + fileId.trim() + ":" + sheetId.trim();
|
String configVersionKey = "tencent:doc:sync:config_version:" + fileId.trim() + ":" + sheetId.trim();
|
||||||
redisCache.deleteObject(syncProgressKey);
|
redisCache.deleteObject(syncProgressKey);
|
||||||
redisCache.deleteObject(configVersionKey);
|
redisCache.deleteObject(configVersionKey);
|
||||||
log.info("配置已更新,已清除同步进度,将从第 {} 行重新开始同步", startRow);
|
log.info("配置已更新,已清除同步进度 - key: {}, 将从第 {} 行重新开始同步", syncProgressKey, startRow);
|
||||||
|
|
||||||
// 同时更新TencentDocConfig对象(内存中)
|
// 同时更新TencentDocConfig对象(内存中)
|
||||||
tencentDocConfig.setFileId(fileId.trim());
|
tencentDocConfig.setFileId(fileId.trim());
|
||||||
|
|||||||
Reference in New Issue
Block a user