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
61d4c8f8
Commit
61d4c8f8
authored
May 14, 2020
by
huangfusuper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改事实日志主键规则
parent
2f7bfe9f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
6 deletions
+6
-6
ApiNodeServiceImpl.java
...c/main/java/com/byit/service/impl/ApiNodeServiceImpl.java
+3
-3
ScriptExecutorJobTask.java
...re/src/main/java/com/byit/task/ScriptExecutorJobTask.java
+2
-2
MythJobProcess.java
...server/src/main/java/com/byit/process/MythJobProcess.java
+1
-1
No files found.
byit-myth-admin/src/main/java/com/byit/service/impl/ApiNodeServiceImpl.java
View file @
61d4c8f8
...
...
@@ -59,7 +59,7 @@ public class ApiNodeServiceImpl implements ApiNodeService {
RunNode
runNode
=
JSON
.
parseObject
(
param
,
RunNode
.
class
);
ValidationUtil
.
dataNotBank
(
runNode
.
getNodeId
(),
"节点id不允许为空!"
);
String
runId
=
"REAL
-EXEC-
"
+
runNode
.
getNodeId
();
String
runId
=
"REAL
:EXEC:
"
+
runNode
.
getNodeId
();
ValidationUtil
.
dataNotBank
(
runNode
.
getNodeName
(),
"节点名称不允许为空!"
);
ValidationUtil
.
dataNotBank
(
runNode
.
getRunCmd
(),
"运行命令不允许为空!"
);
ValidationUtil
.
dataNotBank
(
runNode
.
getJobType
(),
"节点类型不允许为空!"
);
...
...
@@ -99,7 +99,7 @@ public class ApiNodeServiceImpl implements ApiNodeService {
TimerTask
timerTask
=
new
ScriptExecutorJobTask
(
schedule
);
WorkRoulette
.
addJob
(
timerTask
,
triggerTime
);
RunLog
runLog
=
RunLog
.
builder
().
isEnd
(
false
).
runLog
(
"等待服务器分配资源"
).
build
();
String
runKey
=
"REAL
-EXEC-
"
+
logId
;
String
runKey
=
"REAL
:EXEC:
"
+
logId
;
stringRedisTemplate
.
convertAndSend
(
runKey
,
JSON
.
toJSONString
(
runLog
,
WriteClassName
));
...
...
@@ -117,7 +117,7 @@ public class ApiNodeServiceImpl implements ApiNodeService {
public
List
<
JobTaskRunLog
>
runHistory
(
String
nodeId
)
{
ValidationUtil
.
dataNotBank
(
nodeId
,
"nodeId不允许为空!"
);
String
runId
=
"REAL
-EXEC-
"
+
nodeId
;
String
runId
=
"REAL
:EXEC:
"
+
nodeId
;
List
<
JobTaskRunLog
>
jobTaskRunLogList
=
jobTaskRunLogMapper
.
findByRunId
(
runId
);
...
...
byit-myth-core/myth-admin-core/src/main/java/com/byit/task/ScriptExecutorJobTask.java
View file @
61d4c8f8
...
...
@@ -110,9 +110,9 @@ public class ScriptExecutorJobTask implements TimerTask {
}
catch
(
Exception
e
){
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));
//stringRedisTemplate.convertAndSend("REAL
:EXEC:
" + mythJobTaskSchedule.getLogId() , JSON.toJSONString(runLog, WriteClassName));
//使用redis 想队尾push一个值
stringRedisTemplate
.
opsForList
().
rightPush
(
"REAL
-EXEC-
"
+
mythJobTaskSchedule
.
getLogId
()
,
JSON
.
toJSONString
(
runLog
,
WriteClassName
));
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-executor/myth-executor-server/src/main/java/com/byit/process/MythJobProcess.java
View file @
61d4c8f8
...
...
@@ -70,7 +70,7 @@ public class MythJobProcess implements Callable<String>{
this
.
completeLatch
=
new
CountDownLatch
(
1
);
this
.
logId
=
logId
;
this
.
stringRedisTemplate
=
stringRedisTemplate
;
this
.
runKey
=
"REAL
-EXEC-
"
+
logId
;
this
.
runKey
=
"REAL
:EXEC:
"
+
logId
;
}
public
MythJobProcess
(
final
List
<
String
>
cmd
,
final
Map
<
String
,
String
>
env
,
...
...
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