Commit 6e2a651a authored by 钱坤's avatar 钱坤

基金净值缓存刷新触发job重复执行下,因为hangjia那边是幂等的,且是多进程的

parent b5d9866f
......@@ -27,6 +27,8 @@ public class FundNavCacheJob {
private String ifaIdList;
@Value("${tanpu.most.used.fund.nav.cache.limit:200}")
private int limit;
@Value("${tanpu.fund.nav.cache.invoke.repeat:10}")
private int repeat;
@Scheduled(cron = "10 1 * * * ?")
public void execute() {
......@@ -37,9 +39,12 @@ public class FundNavCacheJob {
log.info("刷新指定ifa的基金净值缓存job开始");
String[] ss = ifaIdList.split(",");
for (String id : ss) {
log.info("开始刷新ifa=" + id + "的基金净值缓存");
CommonResp resp = feignForHangjia.reloadFundNav4Ifa(sign, id);
log.info("ifa=" + id + "的基金净值缓存刷新结果: " + resp);
for (int i = 0; i < repeat; i++) {
log.info("开始刷新ifa=" + id + "的基金净值缓存, repeat: " + repeat);
CommonResp resp = feignForHangjia.reloadFundNav4Ifa(sign, id);
log.info("ifa=" + id + "的基金净值缓存刷新结果: " + resp);
Thread.sleep(500);
}
Thread.sleep(1000);
}
}
......@@ -50,10 +55,13 @@ public class FundNavCacheJob {
}
try {
log.info("开始刷新使用最多基金净值缓存, limit: " + limit);
sign = DateUtils.format(DateUtils.nowDate()).replace(" ", "");
CommonResp resp = feignForHangjia.reloadMostUsedFundNav(sign, limit);
log.info("使用最多基金净值缓存刷新结果: " + resp);
for (int i = 0; i < repeat; i++) {
log.info("开始刷新使用最多基金净值缓存, limit: " + limit);
sign = DateUtils.format(DateUtils.nowDate()).replace(" ", "");
CommonResp resp = feignForHangjia.reloadMostUsedFundNav(sign, limit);
log.info("使用最多基金净值缓存刷新结果: " + resp);
Thread.sleep(500);
}
} catch (Exception e) {
log.error("", e);
} finally {
......
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