Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
midjourney-proxy
Overview
Overview
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
徐少华
midjourney-proxy
Commits
051ad79d
Commit
051ad79d
authored
Feb 13, 2020
by
桂前礼
Committed by
unknown
Feb 14, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug
parent
f0e0802c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
8 deletions
+16
-8
PcloudGuideSilenceRunnerImpl.java
...cloud/book/guide/runner/PcloudGuideSilenceRunnerImpl.java
+16
-8
No files found.
pcloud-service-book/src/main/java/com/pcloud/book/guide/runner/PcloudGuideSilenceRunnerImpl.java
View file @
051ad79d
...
...
@@ -46,13 +46,20 @@ public class PcloudGuideSilenceRunnerImpl implements ApplicationRunner {
public
void
run
(
ApplicationArguments
applicationArguments
)
throws
Exception
{
log
.
info
(
"[项目启动后 定时检查引导与推送]"
);
if
(!
JedisClusterUtils
.
setnx
(
PCLOUD_GUIDE_LOCK
,
PCLOUD_GUIDE_LOCK
))
{
JedisClusterUtils
.
expire
(
PCLOUD_GUIDE_LOCK
,
15
*
60
);
return
;
if
(!
JedisClusterUtils
.
exists
(
PCLOUD_GUIDE_LOCK
))
{
JedisClusterUtils
.
set
(
PCLOUD_GUIDE_LOCK
,
"1"
);
}
else
{
if
(
"1"
.
equals
(
JedisClusterUtils
.
get
(
PCLOUD_GUIDE_LOCK
)))
{
JedisClusterUtils
.
set
(
PCLOUD_GUIDE_LOCK
,
"0"
);
return
;
}
else
{
JedisClusterUtils
.
set
(
PCLOUD_GUIDE_LOCK
,
"1"
);
}
}
new
Thread
(()
->
{
log
.
info
(
"[PcloudGuideSilenceRunnerImpl] 线程启动成功"
);
while
(
true
)
{
try
{
Thread
.
sleep
(
1000
);
...
...
@@ -100,11 +107,11 @@ public class PcloudGuideSilenceRunnerImpl implements ApplicationRunner {
.
spanTime
((
pcloudGuide
.
getTimeSpan
()
==
null
?
0
:
pcloudGuide
.
getTimeSpan
())).
num
(
pcloudGuideDelayDto
.
getNum
()
+
1
)
.
robotWxId
(
pcloudGuideDelayDto
.
getRobotWxId
()).
ip
(
pcloudGuideDelayDto
.
getIp
()).
code
(
pcloudGuideDelayDto
.
getCode
()).
msgList
(
messageVOList
).
build
();
if
(
JSONObject
.
toJSONString
(
guideDelayDto
)==
null
)
{
guideDelayDto
=
PcloudGuideDelayDto
.
builder
().
sendTime
(
new
Date
()).
duration
(
0
)
.
spanTime
((
pcloudGuide
.
getTimeSpan
()
==
null
?
0
:
pcloudGuide
.
getTimeSpan
())).
num
(
pcloudGuideDelayDto
.
getNum
()
+
1
)
.
robotWxId
(
pcloudGuideDelayDto
.
getRobotWxId
()).
code
(
pcloudGuideDelayDto
.
getCode
()).
ip
(
pcloudGuideDelayDto
.
getIp
()).
build
();
}
if
(
JSONObject
.
toJSONString
(
guideDelayDto
)
==
null
)
{
guideDelayDto
=
PcloudGuideDelayDto
.
builder
().
sendTime
(
new
Date
()).
duration
(
0
)
.
spanTime
((
pcloudGuide
.
getTimeSpan
()
==
null
?
0
:
pcloudGuide
.
getTimeSpan
())).
num
(
pcloudGuideDelayDto
.
getNum
()
+
1
)
.
robotWxId
(
pcloudGuideDelayDto
.
getRobotWxId
()).
code
(
pcloudGuideDelayDto
.
getCode
()).
ip
(
pcloudGuideDelayDto
.
getIp
()).
build
();
}
JedisClusterUtils
.
hset
(
pcloudGuideDelayDto
.
getRobotWxId
()
+
PCLOUD_GUIDE_SUFFIX
,
userId
,
JSONObject
.
toJSONString
(
guideDelayDto
));
}
else
{
...
...
@@ -118,6 +125,7 @@ public class PcloudGuideSilenceRunnerImpl implements ApplicationRunner {
log
.
error
(
"引导语延时发送,处理失败"
,
e
);
}
}
}).
start
();
}
}
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