Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
byit-myth-job
Overview
Overview
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
liyuan
byit-myth-job
Commits
96e5fb9e
Commit
96e5fb9e
authored
Jul 21, 2020
by
huangfusuper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
改变获取逻辑
parent
1051a227
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
1 deletion
+16
-1
ApiNodeServiceImpl.java
...c/main/java/com/byit/service/impl/ApiNodeServiceImpl.java
+1
-0
JavaNodeExecutorTask.java
...ore/src/main/java/com/byit/task/JavaNodeExecutorTask.java
+10
-1
ScriptExecutorJobTask.java
...re/src/main/java/com/byit/task/ScriptExecutorJobTask.java
+3
-0
RunNode.java
...h-dto-core/src/main/java/com/byit/dto/plugin/RunNode.java
+2
-0
No files found.
byit-myth-admin/src/main/java/com/byit/service/impl/ApiNodeServiceImpl.java
View file @
96e5fb9e
...
...
@@ -90,6 +90,7 @@ public class ApiNodeServiceImpl implements ApiNodeService {
schedule
.
setJobType
(
runNode
.
getJobType
());
schedule
.
setTriggerTime
(
triggerTime
);
schedule
.
setScheduleType
(
ScheduleTypeEnum
.
REAL
.
getCode
());
schedule
.
setHandlerName
(
runNode
.
getHandlerName
());
String
runCommand
=
schedule
.
getRunCommand
();
...
...
byit-myth-core/myth-admin-core/src/main/java/com/byit/task/JavaNodeExecutorTask.java
View file @
96e5fb9e
...
...
@@ -21,6 +21,8 @@ import io.netty.util.TimerTask;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.data.redis.core.StringRedisTemplate
;
import
java.util.Date
;
import
static
com
.
alibaba
.
fastjson
.
serializer
.
SerializerFeature
.
WriteClassName
;
/**
...
...
@@ -78,9 +80,10 @@ public class JavaNodeExecutorTask implements TimerTask {
communicationParam
.
setBody
(
mythJobTaskSchedule
.
getRunParam
());
request
.
setParam
(
communicationParam
);
request
.
setJobName
(
mythJobTaskSchedule
.
get
Node
Name
());
request
.
setJobName
(
mythJobTaskSchedule
.
get
Handler
Name
());
request
.
setExtension
(
jobTaskRunLogById
.
getLogId
()+
""
);
jobTaskRunLogById
.
setLogId
(
jobTaskRunLogById
.
getLogId
());
jobTaskRunLogById
.
setStartTime
(
new
Date
());
PluginRpcResponsePacket
pluginRpcResponsePacket
=
service
.
runJava
(
request
);
if
(
pluginRpcResponsePacket
.
isStatus
()){
...
...
@@ -90,13 +93,19 @@ public class JavaNodeExecutorTask implements TimerTask {
}
jobTaskRunLogById
.
setTriggerMsg
(
pluginRpcResponsePacket
.
getMsg
());
jobTaskRunLogById
.
setJobGroupIp
(
pluginRpcResponsePacket
.
getRunIp
());
jobTaskRunLogById
.
setRunParams
(
mythJobTaskSchedule
.
getRunParam
());
jobTaskRunLogById
.
setRunType
(
"2"
);
jobTaskRunLogById
.
setAlertEnd
(
"1"
);
}
catch
(
Exception
e
){
if
(
mythJobTaskSchedule
.
getScheduleType
().
equals
(
4
))
{
StringRedisTemplate
stringRedisTemplate
=
(
StringRedisTemplate
)
SpringUtil
.
getBean
(
"stringRedisTemplate"
);
RunLog
runLog
=
RunLog
.
builder
().
isEnd
(
true
).
isSuccess
(
false
).
runLog
(
"执行资源异常"
+
e
.
getMessage
()).
build
();
//stringRedisTemplate.convertAndSend("REAL:EXEC:" + mythJobTaskSchedule.getLogId() , JSON.toJSONString(runLog, WriteClassName));
//使用redis 想队尾push一个值
stringRedisTemplate
.
opsForList
().
rightPush
(
"REAL:EXEC:"
+
mythJobTaskSchedule
.
getLogId
()
,
JSON
.
toJSONString
(
runLog
,
WriteClassName
));
}
log
.
error
(
"------执行机异常{}-----"
,
e
.
getMessage
());
jobTaskRunLogById
.
setTriggerCode
(
RunResultEnum
.
TRIGGER_ERROR
.
getCode
());
jobTaskRunLogById
.
setRunCode
(
RunResultEnum
.
RUN_ERROR
.
getCode
());
...
...
byit-myth-core/myth-admin-core/src/main/java/com/byit/task/ScriptExecutorJobTask.java
View file @
96e5fb9e
...
...
@@ -103,11 +103,14 @@ public class ScriptExecutorJobTask implements TimerTask {
scriptDto
.
setLogRemotePath
(
jobTaskRunLogById
.
getLogRemotelyPath
());
dispatchResponseDto
=
runScriptService
.
runScript
(
scriptDto
);
}
catch
(
Exception
e
){
if
(
mythJobTaskSchedule
.
getScheduleType
().
equals
(
4
))
{
StringRedisTemplate
stringRedisTemplate
=
(
StringRedisTemplate
)
SpringUtil
.
getBean
(
"stringRedisTemplate"
);
RunLog
runLog
=
RunLog
.
builder
().
isEnd
(
true
).
isSuccess
(
false
).
runLog
(
"执行资源异常"
+
e
.
getMessage
()).
build
();
//stringRedisTemplate.convertAndSend("REAL:EXEC:" + mythJobTaskSchedule.getLogId() , JSON.toJSONString(runLog, WriteClassName));
//使用redis 想队尾push一个值
stringRedisTemplate
.
opsForList
().
rightPush
(
"REAL:EXEC:"
+
mythJobTaskSchedule
.
getLogId
()
,
JSON
.
toJSONString
(
runLog
,
WriteClassName
));
}
log
.
error
(
"------执行机异常{}-----"
,
e
.
getMessage
());
dispatchResponseDto
.
setMsg
(
e
.
getMessage
());
dispatchResponseDto
.
setCode
(
JobResultEnum
.
DISPATCH_FAIL
.
getCode
());
...
...
byit-myth-core/myth-dto-core/src/main/java/com/byit/dto/plugin/RunNode.java
View file @
96e5fb9e
...
...
@@ -43,6 +43,8 @@ public class RunNode implements Serializable {
*/
private
String
runSource
;
private
String
handlerName
;
/**
* 脚本类型
*/
...
...
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