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
be13e0c0
Unverified
Commit
be13e0c0
authored
Nov 01, 2023
by
aiwenmo
Committed by
GitHub
Nov 01, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Fix-1615] [api] Fix submit task error but return succeed when using dolphinscheduler (#2469)
Co-authored-by:
wenmo
<
32723967+wenmo@users.noreply.github.com
>
parent
55252345
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
5 deletions
+18
-5
APIController.java
...min/src/main/java/org/dinky/controller/APIController.java
+17
-2
TaskServiceImpl.java
...src/main/java/org/dinky/service/impl/TaskServiceImpl.java
+0
-2
JobResult.java
dinky-core/src/main/java/org/dinky/job/JobResult.java
+1
-1
No files found.
dinky-admin/src/main/java/org/dinky/controller/APIController.java
View file @
be13e0c0
...
@@ -24,6 +24,7 @@ import org.dinky.data.dto.TaskDTO;
...
@@ -24,6 +24,7 @@ import org.dinky.data.dto.TaskDTO;
import
org.dinky.data.enums.BusinessType
;
import
org.dinky.data.enums.BusinessType
;
import
org.dinky.data.enums.Status
;
import
org.dinky.data.enums.Status
;
import
org.dinky.data.exception.NotSupportExplainExcepition
;
import
org.dinky.data.exception.NotSupportExplainExcepition
;
import
org.dinky.data.model.ID
;
import
org.dinky.data.model.JobInstance
;
import
org.dinky.data.model.JobInstance
;
import
org.dinky.data.result.Result
;
import
org.dinky.data.result.Result
;
import
org.dinky.data.result.SqlExplainResult
;
import
org.dinky.data.result.SqlExplainResult
;
...
@@ -64,11 +65,25 @@ public class APIController {
...
@@ -64,11 +65,25 @@ public class APIController {
private
final
TaskService
taskService
;
private
final
TaskService
taskService
;
private
final
JobInstanceService
jobInstanceService
;
private
final
JobInstanceService
jobInstanceService
;
// Interface compatible with DolphinScheduler
@GetMapping
(
"/submitTask"
)
@ApiOperation
(
"Submit Task"
)
public
Result
<
JobResult
>
submitTask
(
@RequestParam
Integer
id
)
throws
Exception
{
taskService
.
initTenantByTaskId
(
id
);
JobResult
jobResult
=
taskService
.
submitTask
(
id
,
null
);
if
(
jobResult
.
isSuccess
())
{
return
Result
.
succeed
(
jobResult
,
Status
.
EXECUTE_SUCCESS
);
}
else
{
return
Result
.
failed
(
jobResult
,
jobResult
.
getError
());
}
}
@PostMapping
(
"/submitTask"
)
@PostMapping
(
"/submitTask"
)
@ApiOperation
(
"Submit Task"
)
@ApiOperation
(
"Submit Task"
)
// @Log(title = "Submit Task", businessType = BusinessType.SUBMIT)
// @Log(title = "Submit Task", businessType = BusinessType.SUBMIT)
public
Result
<
JobResult
>
submitTask
(
@RequestBody
TaskDTO
taskDTO
)
throws
Exception
{
public
Result
<
JobResult
>
submitTask
(
@RequestBody
ID
id
)
throws
Exception
{
JobResult
jobResult
=
taskService
.
submitTask
(
taskDTO
.
getId
(),
null
);
taskService
.
initTenantByTaskId
(
id
.
getId
());
JobResult
jobResult
=
taskService
.
submitTask
(
id
.
getId
(),
null
);
if
(
jobResult
.
isSuccess
())
{
if
(
jobResult
.
isSuccess
())
{
return
Result
.
succeed
(
jobResult
,
Status
.
EXECUTE_SUCCESS
);
return
Result
.
succeed
(
jobResult
,
Status
.
EXECUTE_SUCCESS
);
}
else
{
}
else
{
...
...
dinky-admin/src/main/java/org/dinky/service/impl/TaskServiceImpl.java
View file @
be13e0c0
...
@@ -256,8 +256,6 @@ public class TaskServiceImpl extends SuperServiceImpl<TaskMapper, Task> implemen
...
@@ -256,8 +256,6 @@ public class TaskServiceImpl extends SuperServiceImpl<TaskMapper, Task> implemen
@Override
@Override
@ProcessStep
(
type
=
ProcessStepType
.
SUBMIT_TASK
)
@ProcessStep
(
type
=
ProcessStepType
.
SUBMIT_TASK
)
public
JobResult
submitTask
(
Integer
id
,
String
savePointPath
)
throws
Exception
{
public
JobResult
submitTask
(
Integer
id
,
String
savePointPath
)
throws
Exception
{
initTenantByTaskId
(
id
);
TaskDTO
taskDTO
=
this
.
getTaskInfoById
(
id
);
TaskDTO
taskDTO
=
this
.
getTaskInfoById
(
id
);
if
(
StringUtils
.
isNotBlank
(
savePointPath
))
{
if
(
StringUtils
.
isNotBlank
(
savePointPath
))
{
...
...
dinky-core/src/main/java/org/dinky/job/JobResult.java
View file @
be13e0c0
...
@@ -128,7 +128,7 @@ public class JobResult {
...
@@ -128,7 +128,7 @@ public class JobResult {
this
.
jobConfig
=
jobConfig
;
this
.
jobConfig
=
jobConfig
;
this
.
jobManagerAddress
=
jobManagerAddress
;
this
.
jobManagerAddress
=
jobManagerAddress
;
this
.
status
=
status
;
this
.
status
=
status
;
this
.
success
=
(
status
==
(
Job
.
JobStatus
.
SUCCESS
))
?
true
:
false
;
this
.
success
=
status
==
(
Job
.
JobStatus
.
SUCCESS
)
;
this
.
statement
=
statement
;
this
.
statement
=
statement
;
this
.
jobId
=
jobId
;
this
.
jobId
=
jobId
;
this
.
error
=
error
;
this
.
error
=
error
;
...
...
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