Commit c1faad0a authored by 张辰's avatar 张辰

fix duplicate key bug in local cache

parent 667f4b45
......@@ -176,20 +176,20 @@ public class FeignService {
} else {
feignIds.add(key);
}
}
if (!feignIds.isEmpty()) {
List<T> remoteList = feignFunc.apply(feignIds);
log.info("batchExecute feign returns {} -> {}", JSON.toJSONString(feignIds), JSON.toJSONString(remoteList));
if (!feignIds.isEmpty()) {
List<T> remoteList = feignFunc.apply(feignIds);
// log.info("batchExecute feign returns {} -> {}", JSON.toJSONString(feignIds), JSON.toJSONString(remoteList));
if (remoteList != null) {
retList.addAll(remoteList);
retList.forEach(r -> {
localCache.putObject(keyPrefix + getKeyFunc.apply(r), r);
});
}
if (remoteList != null) {
retList.addAll(remoteList);
retList.forEach(r -> {
localCache.putObject(keyPrefix + getKeyFunc.apply(r), r);
});
}
}
log.info("batchExecute {} : {} -> {}", keyPrefix, JSON.toJSONString(keys), JSON.toJSONString(retList));
// log.info("batchExecute {} : {} -> {}", keyPrefix, JSON.toJSONString(keys), JSON.toJSONString(retList));
return retList;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment