Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dinky
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangpeng
dinky
Commits
e8c0bcbc
Unverified
Commit
e8c0bcbc
authored
Oct 18, 2023
by
gaoyan
Committed by
GitHub
Oct 18, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix cache bug (#2397)
parent
d2db3d90
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
9 deletions
+14
-9
Task.java
dinky-admin/src/main/java/org/dinky/data/model/Task.java
+7
-2
TaskServiceImpl.java
...src/main/java/org/dinky/service/impl/TaskServiceImpl.java
+7
-7
No files found.
dinky-admin/src/main/java/org/dinky/data/model/Task.java
View file @
e8c0bcbc
...
@@ -31,7 +31,7 @@ import io.swagger.annotations.ApiModel;
...
@@ -31,7 +31,7 @@ import io.swagger.annotations.ApiModel;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.EqualsAndHashCode
;
import
lombok.
extern.slf4j.Slf4j
;
import
lombok.
NoArgsConstructor
;
/**
/**
* 任务
* 任务
...
@@ -41,7 +41,7 @@ import lombok.extern.slf4j.Slf4j;
...
@@ -41,7 +41,7 @@ import lombok.extern.slf4j.Slf4j;
@Data
@Data
@EqualsAndHashCode
(
callSuper
=
false
)
@EqualsAndHashCode
(
callSuper
=
false
)
@TableName
(
"dinky_task"
)
@TableName
(
"dinky_task"
)
@
Slf4j
@
NoArgsConstructor
@ApiModel
(
value
=
"Task"
,
description
=
"Task Information"
)
@ApiModel
(
value
=
"Task"
,
description
=
"Task Information"
)
public
class
Task
extends
SuperEntity
<
Task
>
{
public
class
Task
extends
SuperEntity
<
Task
>
{
...
@@ -164,4 +164,9 @@ public class Task extends SuperEntity<Task> {
...
@@ -164,4 +164,9 @@ public class Task extends SuperEntity<Task> {
@ApiModelProperty
(
value
=
"Statement"
,
dataType
=
"String"
,
notes
=
"SQL statement for the task"
)
@ApiModelProperty
(
value
=
"Statement"
,
dataType
=
"String"
,
notes
=
"SQL statement for the task"
)
private
String
statement
;
private
String
statement
;
public
Task
(
Integer
id
,
Integer
jobInstanceId
)
{
this
.
jobInstanceId
=
jobInstanceId
;
this
.
setId
(
id
);
}
}
}
dinky-admin/src/main/java/org/dinky/service/impl/TaskServiceImpl.java
View file @
e8c0bcbc
...
@@ -271,22 +271,22 @@ public class TaskServiceImpl extends SuperServiceImpl<TaskMapper, Task> implemen
...
@@ -271,22 +271,22 @@ public class TaskServiceImpl extends SuperServiceImpl<TaskMapper, Task> implemen
public
JobResult
submitTask
(
Integer
id
,
String
savePointPath
)
throws
Exception
{
public
JobResult
submitTask
(
Integer
id
,
String
savePointPath
)
throws
Exception
{
initTenantByTaskId
(
id
);
initTenantByTaskId
(
id
);
TaskDTO
task
=
this
.
getTaskInfoById
(
id
);
TaskDTO
task
DTO
=
this
.
getTaskInfoById
(
id
);
if
(
StringUtils
.
isNotBlank
(
savePointPath
))
{
if
(
StringUtils
.
isNotBlank
(
savePointPath
))
{
task
.
setSavePointStrategy
(
SavePointStrategy
.
CUSTOM
.
getValue
());
task
DTO
.
setSavePointStrategy
(
SavePointStrategy
.
CUSTOM
.
getValue
());
task
.
setSavePointPath
(
savePointPath
);
task
DTO
.
setSavePointPath
(
savePointPath
);
}
}
// 注解自调用会失效,这里通过获取对象方法绕过此限制
// 注解自调用会失效,这里通过获取对象方法绕过此限制
TaskServiceImpl
taskServiceBean
=
applicationContext
.
getBean
(
TaskServiceImpl
.
class
);
TaskServiceImpl
taskServiceBean
=
applicationContext
.
getBean
(
TaskServiceImpl
.
class
);
taskServiceBean
.
preCheckTask
(
task
);
taskServiceBean
.
preCheckTask
(
task
DTO
);
JobResult
jobResult
=
taskServiceBean
.
executeJob
(
task
);
JobResult
jobResult
=
taskServiceBean
.
executeJob
(
task
DTO
);
if
(
Job
.
JobStatus
.
SUCCESS
==
jobResult
.
getStatus
())
{
if
(
Job
.
JobStatus
.
SUCCESS
==
jobResult
.
getStatus
())
{
log
.
info
(
"Job Submit success"
);
log
.
info
(
"Job Submit success"
);
task
.
setJobInstanceId
(
jobResult
.
getJobInstanceId
());
Task
task
=
new
Task
(
id
,
jobResult
.
getJobInstanceId
());
if
(!
this
.
updateById
(
task
.
buildTask
()
))
{
if
(!
this
.
updateById
(
task
))
{
throw
new
BusException
(
Status
.
TASK_UPDATE_FAILED
.
getMessage
());
throw
new
BusException
(
Status
.
TASK_UPDATE_FAILED
.
getMessage
());
}
}
}
else
{
}
else
{
...
...
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