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
3f9f6664
Commit
3f9f6664
authored
May 18, 2020
by
huangfusuper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完善日志信息
parent
54dd1ba0
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
3 deletions
+14
-3
ApiNodeServiceImpl.java
...c/main/java/com/byit/service/impl/ApiNodeServiceImpl.java
+7
-3
MythJobProcess.java
...server/src/main/java/com/byit/process/MythJobProcess.java
+7
-0
No files found.
byit-myth-admin/src/main/java/com/byit/service/impl/ApiNodeServiceImpl.java
View file @
3f9f6664
...
...
@@ -105,13 +105,17 @@ public class ApiNodeServiceImpl implements ApiNodeService {
Integer
logId
=
jobTaskRunLog
.
getLogId
();
//设置日志id
schedule
.
setLogId
(
logId
);
TimerTask
timerTask
=
new
ScriptExecutorJobTask
(
schedule
);
WorkRoulette
.
addJob
(
timerTask
,
triggerTime
);
RunLog
runLog
=
RunLog
.
builder
().
isEnd
(
false
).
runLog
(
"等待服务器分配资源"
).
build
();
String
runKey
=
"REAL:EXEC:"
+
logId
;
stringRedisTemplate
.
opsForList
().
rightPush
(
runKey
,
JSON
.
toJSONString
(
runLog
,
WriteClassName
));
TimerTask
timerTask
=
new
ScriptExecutorJobTask
(
schedule
);
WorkRoulette
.
addJob
(
timerTask
,
triggerTime
);
RunLog
runLogEnd
=
RunLog
.
builder
().
isEnd
(
false
).
runLog
(
"服务器分配资源成功"
).
build
();
stringRedisTemplate
.
opsForList
().
rightPush
(
runKey
,
JSON
.
toJSONString
(
runLogEnd
,
WriteClassName
));
return
runKey
;
}
...
...
byit-myth-executor/myth-executor-server/src/main/java/com/byit/process/MythJobProcess.java
View file @
3f9f6664
...
...
@@ -120,6 +120,13 @@ public class MythJobProcess implements Callable<String>{
log
.
info
(
"进程的id "
+
this
.
processId
);
}
if
(
stringRedisTemplate
!=
null
)
{
RunLog
runLog
=
RunLog
.
builder
().
isEnd
(
false
).
runLog
(
"开始执行"
).
build
();
//TODO 向队列队尾插入一个值
Long
aLong
=
stringRedisTemplate
.
opsForList
().
rightPush
(
runKey
,
JSON
.
toJSONString
(
runLog
,
WriteClassName
));
log
.
info
(
"-------{}-------"
,
aLong
);
}
outputGobbler
=
new
LogGobbler
(
new
InputStreamReader
(
this
.
process
.
getInputStream
(),
"utf-8"
),
Boolean
.
FALSE
,
30
,
runKey
,
stringRedisTemplate
);
errorGobbler
=
new
LogGobbler
(
new
InputStreamReader
(
this
.
process
.
getErrorStream
(),
"utf-8"
),
Boolean
.
TRUE
,
30
,
runKey
,
stringRedisTemplate
);
//开始获取进程的运行日志
...
...
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