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
38262e06
Unverified
Commit
38262e06
authored
Sep 01, 2021
by
Emil-Zhang
Committed by
GitHub
Sep 01, 2021
Browse files
修复手动清除子任务id后导致运行定时任务报错 (#671)
parent
fc43600b
Changes
1
Hide whitespace changes
Inline
Side-by-side
eladmin-system/src/main/java/me/zhengjie/modules/quartz/service/impl/QuartzJobServiceImpl.java
View file @
38262e06
...
@@ -16,6 +16,7 @@
...
@@ -16,6 +16,7 @@
package
me.zhengjie.modules.quartz.service.impl
;
package
me.zhengjie.modules.quartz.service.impl
;
import
cn.hutool.core.util.IdUtil
;
import
cn.hutool.core.util.IdUtil
;
import
cn.hutool.core.util.StrUtil
;
import
lombok.RequiredArgsConstructor
;
import
lombok.RequiredArgsConstructor
;
import
me.zhengjie.exception.BadRequestException
;
import
me.zhengjie.exception.BadRequestException
;
import
me.zhengjie.modules.quartz.domain.QuartzJob
;
import
me.zhengjie.modules.quartz.domain.QuartzJob
;
...
@@ -133,6 +134,10 @@ public class QuartzJobServiceImpl implements QuartzJobService {
...
@@ -133,6 +134,10 @@ public class QuartzJobServiceImpl implements QuartzJobService {
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
executionSubJob
(
String
[]
tasks
)
throws
InterruptedException
{
public
void
executionSubJob
(
String
[]
tasks
)
throws
InterruptedException
{
for
(
String
id
:
tasks
)
{
for
(
String
id
:
tasks
)
{
if
(
StrUtil
.
isBlank
(
id
))
{
// 如果是手动清除子任务id,会出现id为空字符串的问题
continue
;
}
QuartzJob
quartzJob
=
findById
(
Long
.
parseLong
(
id
));
QuartzJob
quartzJob
=
findById
(
Long
.
parseLong
(
id
));
// 执行任务
// 执行任务
String
uuid
=
IdUtil
.
simpleUUID
();
String
uuid
=
IdUtil
.
simpleUUID
();
...
...
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