Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in
Toggle navigation
T
tamp_fund
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
周鹏
tamp_fund
Commits
6e2a651a
Commit
6e2a651a
authored
Apr 29, 2022
by
钱坤
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
基金净值缓存刷新触发job重复执行下,因为hangjia那边是幂等的,且是多进程的
parent
b5d9866f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
7 deletions
+15
-7
FundNavCacheJob.java
src/main/java/com/tanpu/fund/job/FundNavCacheJob.java
+15
-7
No files found.
src/main/java/com/tanpu/fund/job/FundNavCacheJob.java
View file @
6e2a651a
...
...
@@ -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
+
"的基金净值缓存"
);
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
{
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
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment