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
6e832bc4
Unverified
Commit
6e832bc4
authored
Oct 21, 2023
by
gaoyan
Committed by
GitHub
Oct 21, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Optimize][Admin]Optimize the process (#2420)
* Optimize the process * forme code
parent
b5b25763
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
0 deletions
+12
-0
ProcessAspect.java
dinky-admin/src/main/java/org/dinky/aop/ProcessAspect.java
+11
-0
TaskServiceImpl.java
...src/main/java/org/dinky/service/impl/TaskServiceImpl.java
+1
-0
No files found.
dinky-admin/src/main/java/org/dinky/aop/ProcessAspect.java
View file @
6e832bc4
...
@@ -27,6 +27,8 @@ import org.dinky.process.enums.ProcessStatus;
...
@@ -27,6 +27,8 @@ import org.dinky.process.enums.ProcessStatus;
import
org.dinky.process.enums.ProcessStepType
;
import
org.dinky.process.enums.ProcessStepType
;
import
org.dinky.process.enums.ProcessType
;
import
org.dinky.process.enums.ProcessType
;
import
org.apache.http.util.TextUtils
;
import
java.lang.annotation.Annotation
;
import
java.lang.annotation.Annotation
;
import
java.lang.reflect.Method
;
import
java.lang.reflect.Method
;
...
@@ -82,6 +84,15 @@ public class ProcessAspect {
...
@@ -82,6 +84,15 @@ public class ProcessAspect {
@Around
(
value
=
"@annotation(processStep)"
)
@Around
(
value
=
"@annotation(processStep)"
)
public
Object
processStepAround
(
ProceedingJoinPoint
joinPoint
,
ProcessStep
processStep
)
throws
Throwable
{
public
Object
processStepAround
(
ProceedingJoinPoint
joinPoint
,
ProcessStep
processStep
)
throws
Throwable
{
String
processName
=
MDC
.
get
(
PROCESS_NAME
);
if
(
TextUtils
.
isEmpty
(
processName
))
{
log
.
warn
(
"Process {} does not exist, This registration step {} was abandoned"
,
processName
,
processStep
.
type
());
return
joinPoint
.
proceed
();
}
Object
result
;
Object
result
;
// Record the current step and restore it after the execution is completed
// Record the current step and restore it after the execution is completed
String
parentStep
=
MDC
.
get
(
PROCESS_STEP
);
String
parentStep
=
MDC
.
get
(
PROCESS_STEP
);
...
...
dinky-admin/src/main/java/org/dinky/service/impl/TaskServiceImpl.java
View file @
6e832bc4
...
@@ -202,6 +202,7 @@ public class TaskServiceImpl extends SuperServiceImpl<TaskMapper, Task> implemen
...
@@ -202,6 +202,7 @@ public class TaskServiceImpl extends SuperServiceImpl<TaskMapper, Task> implemen
return
jobResult
;
return
jobResult
;
}
}
@ProcessStep
(
type
=
ProcessStepType
.
SUBMIT_BUILD_CONFIG
)
public
JobConfig
buildJobConfig
(
TaskDTO
task
)
{
public
JobConfig
buildJobConfig
(
TaskDTO
task
)
{
task
.
setStatement
(
buildEnvSql
(
task
)
+
task
.
getStatement
());
task
.
setStatement
(
buildEnvSql
(
task
)
+
task
.
getStatement
());
JobConfig
config
=
task
.
getJobConfig
();
JobConfig
config
=
task
.
getJobConfig
();
...
...
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