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
861bd8fd
Commit
861bd8fd
authored
May 18, 2020
by
huangfusuper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改日志
parent
1b72b2a8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
11 deletions
+13
-11
RunScriptProcessingMachine.java
...n/java/com/byit/node/impl/RunScriptProcessingMachine.java
+8
-1
MythJobProcess.java
...server/src/main/java/com/byit/process/MythJobProcess.java
+0
-7
LogGobbler.java
...cutor-server/src/main/java/com/byit/utils/LogGobbler.java
+5
-3
No files found.
byit-myth-executor/myth-executor-server/src/main/java/com/byit/node/impl/RunScriptProcessingMachine.java
View file @
861bd8fd
...
...
@@ -32,8 +32,15 @@ public class RunScriptProcessingMachine implements ProcessingMachine {
@Override
public
void
executor
(
ScriptDto
scriptDto
,
ProcessingNodeChain
processingNodeChain
)
{
boolean
isRunNode
=
scriptDto
.
getRunId
().
contains
(
"REAL-EXEC-"
);
List
<
String
>
cmdList
=
Arrays
.
asList
(
scriptDto
.
getCommand
().
split
(
" "
));
MythJobProcess
mythJobProcess
=
new
MythJobProcess
(
cmdList
,
null
,
null
,
scriptDto
.
getLogId
(),
stringRedisTemplate
);
MythJobProcess
mythJobProcess
;
if
(
isRunNode
)
{
mythJobProcess
=
new
MythJobProcess
(
cmdList
,
null
,
null
,
scriptDto
.
getLogId
(),
stringRedisTemplate
);
}
else
{
mythJobProcess
=
new
MythJobProcess
(
cmdList
,
null
,
null
,
scriptDto
.
getLogId
(),
null
);
}
//保存日志
String
logData
=
mythJobProcess
.
call
();
//成功 是0 失败是其他的 杀死是-100
...
...
byit-myth-executor/myth-executor-server/src/main/java/com/byit/process/MythJobProcess.java
View file @
861bd8fd
...
...
@@ -88,13 +88,6 @@ public class MythJobProcess implements Callable<String>{
@SneakyThrows
@Override
public
String
call
()
{
RunLog
startRunLog
=
RunLog
.
builder
().
isEnd
(
false
).
runLog
(
"start"
).
build
();
//stringRedisTemplate.convertAndSend(runKey, JSON.toJSONString(runLog, WriteClassName))
//TODO 向队尾追加一个日志
Long
startLong
=
stringRedisTemplate
.
opsForList
().
rightPush
(
runKey
,
JSON
.
toJSONString
(
startRunLog
,
WriteClassName
));
if
(
startLong
<=
0
){
log
.
error
(
"------日志信息加入redis异常,{}---------"
,
startLong
);
}
//判断是否执行过
if
(
this
.
isStarted
()
||
this
.
isComplete
())
{
throw
new
IllegalStateException
(
"该过程只能使用一次"
);
...
...
byit-myth-executor/myth-executor-server/src/main/java/com/byit/utils/LogGobbler.java
View file @
861bd8fd
...
...
@@ -45,9 +45,11 @@ public class LogGobbler extends Thread {
this
.
buffer
.
append
(
line
+
"\n"
);
runLog
.
setRunLog
(
line
);
//stringRedisTemplate.convertAndSend(runKey, JSON.toJSONString(runLog, WriteClassName))
//TODO 向队列队尾插入一个值
Long
aLong
=
stringRedisTemplate
.
opsForList
().
rightPush
(
runKey
,
JSON
.
toJSONString
(
runLog
,
WriteClassName
));
log
.
info
(
"-------{}-------"
,
aLong
);
if
(
stringRedisTemplate
!=
null
)
{
//TODO 向队列队尾插入一个值
Long
aLong
=
stringRedisTemplate
.
opsForList
().
rightPush
(
runKey
,
JSON
.
toJSONString
(
runLog
,
WriteClassName
));
log
.
info
(
"-------{}-------"
,
aLong
);
}
printLog
(
line
);
}
}
catch
(
final
IOException
e
)
{
...
...
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