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
9c9da3b6
Commit
9c9da3b6
authored
Apr 10, 2020
by
huangfusuper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整执行机结果的设置
parent
ff5b93ae
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
ScriptExecutorServiceImpl.java
...main/java/com/byit/service/ScriptExecutorServiceImpl.java
+11
-0
No files found.
byit-myth-executor/myth-executor-server/src/main/java/com/byit/service/ScriptExecutorServiceImpl.java
View file @
9c9da3b6
...
@@ -108,6 +108,11 @@ public class ScriptExecutorServiceImpl implements ScriptExecutorService {
...
@@ -108,6 +108,11 @@ public class ScriptExecutorServiceImpl implements ScriptExecutorService {
MythJobProcess
mythJobProcess
=
new
MythJobProcess
(
cmdList
,
null
,
null
,
scriptDto
.
getLogId
(),
stringRedisTemplate
);
MythJobProcess
mythJobProcess
=
new
MythJobProcess
(
cmdList
,
null
,
null
,
scriptDto
.
getLogId
(),
stringRedisTemplate
);
//保存日志
//保存日志
String
logData
=
mythJobProcess
.
call
();
String
logData
=
mythJobProcess
.
call
();
//成功 是0 失败是其他的 杀死是-100
int
exitCode
=
mythJobProcess
.
getExitCode
();
if
(
exitCode
==
-
100
){
logData
=
"该任务节点已被强制kill!"
;
}
byte
[]
logDataByte
=
stringToByteArray
(
logData
);
byte
[]
logDataByte
=
stringToByteArray
(
logData
);
Map
<
String
,
String
>
fileMateData
=
new
HashMap
<
String
,
String
>(
2
);
Map
<
String
,
String
>
fileMateData
=
new
HashMap
<
String
,
String
>(
2
);
fileMateData
.
put
(
"filename"
,
scriptDto
.
getRunId
()+
scriptDto
.
getRunId
()+
".log"
);
fileMateData
.
put
(
"filename"
,
scriptDto
.
getRunId
()+
scriptDto
.
getRunId
()+
".log"
);
...
@@ -124,9 +129,15 @@ public class ScriptExecutorServiceImpl implements ScriptExecutorService {
...
@@ -124,9 +129,15 @@ public class ScriptExecutorServiceImpl implements ScriptExecutorService {
}
else
{
}
else
{
//上传日志文件
//上传日志文件
logPath
=
fileSystem
.
uploadFile
(
logDataByte
,
"log"
,
fileMateData
);
logPath
=
fileSystem
.
uploadFile
(
logDataByte
,
"log"
,
fileMateData
);
}
if
(
exitCode
==
0
){
jobRunResultDto
.
setReturnResult
(
ReturnResult
.
SUCCESS
);
jobRunResultDto
.
setReturnResult
(
ReturnResult
.
SUCCESS
);
}
else
{
jobRunResultDto
.
setReturnResult
(
ReturnResult
.
FAIL
);
}
}
}
catch
(
ProcessFailureException
ignored
){
}
catch
(
ProcessFailureException
ignored
){
jobRunResultDto
.
setReturnResult
(
ReturnResult
.
FAIL
);
jobRunResultDto
.
setReturnResult
(
ReturnResult
.
FAIL
);
}
catch
(
IOException
|
MyException
e
)
{
}
catch
(
IOException
|
MyException
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