Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
Eladmin
Commits
157373eb
Unverified
Commit
157373eb
authored
Jun 21, 2020
by
lj-zhu
Committed by
GitHub
Jun 21, 2020
Browse files
Update ExecutionJob.java (#416)
不是子任务时,uuid是空的,需要加个判断。
parent
ed715490
Changes
1
Hide whitespace changes
Inline
Side-by-side
eladmin-system/src/main/java/me/zhengjie/modules/quartz/utils/ExecutionJob.java
View file @
157373eb
...
@@ -54,6 +54,8 @@ public class ExecutionJob extends QuartzJobBean {
...
@@ -54,6 +54,8 @@ public class ExecutionJob extends QuartzJobBean {
QuartzLogRepository
quartzLogRepository
=
SpringContextHolder
.
getBean
(
QuartzLogRepository
.
class
);
QuartzLogRepository
quartzLogRepository
=
SpringContextHolder
.
getBean
(
QuartzLogRepository
.
class
);
QuartzJobService
quartzJobService
=
SpringContextHolder
.
getBean
(
QuartzJobService
.
class
);
QuartzJobService
quartzJobService
=
SpringContextHolder
.
getBean
(
QuartzJobService
.
class
);
RedisUtils
redisUtils
=
SpringContextHolder
.
getBean
(
RedisUtils
.
class
);
RedisUtils
redisUtils
=
SpringContextHolder
.
getBean
(
RedisUtils
.
class
);
String
uuid
=
quartzJob
.
getUuid
();
QuartzLog
log
=
new
QuartzLog
();
QuartzLog
log
=
new
QuartzLog
();
log
.
setJobName
(
quartzJob
.
getJobName
());
log
.
setJobName
(
quartzJob
.
getJobName
());
...
@@ -72,7 +74,9 @@ public class ExecutionJob extends QuartzJobBean {
...
@@ -72,7 +74,9 @@ public class ExecutionJob extends QuartzJobBean {
future
.
get
();
future
.
get
();
long
times
=
System
.
currentTimeMillis
()
-
startTime
;
long
times
=
System
.
currentTimeMillis
()
-
startTime
;
log
.
setTime
(
times
);
log
.
setTime
(
times
);
redisUtils
.
set
(
quartzJob
.
getUuid
(),
true
);
if
(
StringUtils
.
isNotBlank
(
uuid
))
{
redisUtils
.
set
(
uuid
,
true
);
}
// 任务状态
// 任务状态
log
.
setIsSuccess
(
true
);
log
.
setIsSuccess
(
true
);
System
.
out
.
println
(
"任务执行完毕,任务名称:"
+
quartzJob
.
getJobName
()
+
", 执行时间:"
+
times
+
"毫秒"
);
System
.
out
.
println
(
"任务执行完毕,任务名称:"
+
quartzJob
.
getJobName
()
+
", 执行时间:"
+
times
+
"毫秒"
);
...
@@ -84,7 +88,9 @@ public class ExecutionJob extends QuartzJobBean {
...
@@ -84,7 +88,9 @@ public class ExecutionJob extends QuartzJobBean {
quartzJobService
.
executionSubJob
(
tasks
);
quartzJobService
.
executionSubJob
(
tasks
);
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
redisUtils
.
set
(
quartzJob
.
getUuid
(),
false
);
if
(
StringUtils
.
isNotBlank
(
uuid
))
{
redisUtils
.
set
(
uuid
,
false
);
}
System
.
out
.
println
(
"任务执行失败,任务名称:"
+
quartzJob
.
getJobName
());
System
.
out
.
println
(
"任务执行失败,任务名称:"
+
quartzJob
.
getJobName
());
System
.
out
.
println
(
"--------------------------------------------------------------"
);
System
.
out
.
println
(
"--------------------------------------------------------------"
);
long
times
=
System
.
currentTimeMillis
()
-
startTime
;
long
times
=
System
.
currentTimeMillis
()
-
startTime
;
...
...
Write
Preview
Supports
Markdown
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