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

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

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