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
4554b8d3
Commit
4554b8d3
authored
Sep 26, 2020
by
huangfusuper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
日志合并
parent
c1c0baaa
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
JavaFlowFreeTaskCallbackThread.java
.../java/com/byit/thread/JavaFlowFreeTaskCallbackThread.java
+9
-2
No files found.
byit-myth-core/myth-admin-core/src/main/java/com/byit/thread/JavaFlowFreeTaskCallbackThread.java
View file @
4554b8d3
...
@@ -6,6 +6,7 @@ import com.byit.dto.web.ReturnResult;
...
@@ -6,6 +6,7 @@ import com.byit.dto.web.ReturnResult;
import
com.byit.enums.JobResultEnum
;
import
com.byit.enums.JobResultEnum
;
import
com.byit.enums.task.RunResultEnum
;
import
com.byit.enums.task.RunResultEnum
;
import
com.byit.filesystem.FileSystem
;
import
com.byit.filesystem.FileSystem
;
import
com.byit.job.utils.DateUtil
;
import
com.byit.model.JobTaskRunLogWithBLOBs
;
import
com.byit.model.JobTaskRunLogWithBLOBs
;
import
com.byit.model.RunRecording
;
import
com.byit.model.RunRecording
;
import
com.byit.model.Workspace
;
import
com.byit.model.Workspace
;
...
@@ -133,9 +134,15 @@ public class JavaFlowFreeTaskCallbackThread implements Runnable {
...
@@ -133,9 +134,15 @@ public class JavaFlowFreeTaskCallbackThread implements Runnable {
if
(
StringUtils
.
isBlank
(
logRemotelyPath
))
{
if
(
StringUtils
.
isBlank
(
logRemotelyPath
))
{
FileSystem
fileSystem
=
SpringUtil
.
getBean
(
FileSystem
.
class
);
FileSystem
fileSystem
=
SpringUtil
.
getBean
(
FileSystem
.
class
);
byte
[]
sourceLogBytes
=
fileSystem
.
downloaderFile
(
thisLogUrlPath
);
byte
[]
sourceLogBytes
=
fileSystem
.
downloaderFile
(
thisLogUrlPath
);
//间隔日志
String
interval
=
"\n\n\n 游离节点日志,时间:"
+
DateUtil
.
dateFormat
(
new
Date
(),
"yyyy-MM-dd HH:mm:ss"
)+
"\n"
;
byte
[]
intervalByte
=
stringToByteArray
(
interval
);
byte
[]
intervalByteMergeFile
=
mergeFile
(
intervalByte
,
sourceLogBytes
);
//间隔日志
String
runMsg
=
jobTaskRunLogWithBLOBs
.
getRunMsg
();
String
runMsg
=
jobTaskRunLogWithBLOBs
.
getRunMsg
();
byte
[]
bytes
=
stringToByteArray
(
runMsg
);
byte
[]
bytes
=
stringToByteArray
(
runMsg
);
byte
[]
mergeFile
=
mergeFile
(
sourceLogBytes
,
bytes
);
byte
[]
mergeFile
=
mergeFile
(
intervalByteMergeFile
,
bytes
);
Map
<
String
,
String
>
fileMate
=
fileSystem
.
getFileMate
(
thisLogUrlPath
);
Map
<
String
,
String
>
fileMate
=
fileSystem
.
getFileMate
(
thisLogUrlPath
);
String
logPath
=
fileSystem
.
uploadFile
(
mergeFile
,
"log"
,
fileMate
);
String
logPath
=
fileSystem
.
uploadFile
(
mergeFile
,
"log"
,
fileMate
);
jobTaskRunLogWithBLOBs
.
setLogRemotelyPath
(
logPath
);
jobTaskRunLogWithBLOBs
.
setLogRemotelyPath
(
logPath
);
...
@@ -152,7 +159,7 @@ public class JavaFlowFreeTaskCallbackThread implements Runnable {
...
@@ -152,7 +159,7 @@ public class JavaFlowFreeTaskCallbackThread implements Runnable {
public
String
mergeLog
(
String
sourceLogPath
,
String
targetLogPath
)
throws
IOException
{
public
String
mergeLog
(
String
sourceLogPath
,
String
targetLogPath
)
throws
IOException
{
FileSystem
fileSystem
=
SpringUtil
.
getBean
(
FileSystem
.
class
);
FileSystem
fileSystem
=
SpringUtil
.
getBean
(
FileSystem
.
class
);
byte
[]
sourceLogBytes
=
fileSystem
.
downloaderFile
(
sourceLogPath
);
byte
[]
sourceLogBytes
=
fileSystem
.
downloaderFile
(
sourceLogPath
);
String
interval
=
"\n\n\n 游离节点日志
:
\n"
;
String
interval
=
"\n\n\n 游离节点日志
,时间:"
+
DateUtil
.
dateFormat
(
new
Date
(),
"yyyy-MM-dd HH:mm:ss"
)+
"
\n"
;
byte
[]
intervalByte
=
stringToByteArray
(
interval
);
byte
[]
intervalByte
=
stringToByteArray
(
interval
);
sourceLogBytes
=
mergeFile
(
sourceLogBytes
,
intervalByte
);
sourceLogBytes
=
mergeFile
(
sourceLogBytes
,
intervalByte
);
byte
[]
targetLogBytes
=
fileSystem
.
downloaderFile
(
targetLogPath
);
byte
[]
targetLogBytes
=
fileSystem
.
downloaderFile
(
targetLogPath
);
...
...
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