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
c5502c2f
Commit
c5502c2f
authored
May 15, 2020
by
huangfusuper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
取消显示日志的详细信息,改为显示远程路径
parent
56be6a67
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
24 additions
and
22 deletions
+24
-22
application-dev.yml
...-myth-admin/src/main/resources/config/application-dev.yml
+1
-0
application-local.yml
...yth-admin/src/main/resources/config/application-local.yml
+1
-0
application-pro.yml
...-myth-admin/src/main/resources/config/application-pro.yml
+1
-0
application-test.yml
...myth-admin/src/main/resources/config/application-test.yml
+1
-0
RunRecordingAndEmailServiceImpl.java
...vice/mapservice/impl/RunRecordingAndEmailServiceImpl.java
+19
-22
EndAndNotWarningThreadRunHelper.java
...m/byit/thread/helper/EndAndNotWarningThreadRunHelper.java
+1
-0
No files found.
byit-myth-admin/src/main/resources/config/application-dev.yml
View file @
c5502c2f
...
...
@@ -56,6 +56,7 @@ myth-job:
fdfs
:
so-timeout
:
1500
http-port
:
88
connect-timeout
:
600
pool
:
jmx-enabled
:
false
...
...
byit-myth-admin/src/main/resources/config/application-local.yml
View file @
c5502c2f
...
...
@@ -60,6 +60,7 @@ myth-job:
fdfs
:
so-timeout
:
1500
connect-timeout
:
600
http-port
:
88
pool
:
jmx-enabled
:
false
tracker-list
:
...
...
byit-myth-admin/src/main/resources/config/application-pro.yml
View file @
c5502c2f
...
...
@@ -56,6 +56,7 @@ myth-job:
fdfs
:
so-timeout
:
1500
connect-timeout
:
600
http-port
:
8888
pool
:
jmx-enabled
:
false
tracker-list
:
...
...
byit-myth-admin/src/main/resources/config/application-test.yml
View file @
c5502c2f
...
...
@@ -57,6 +57,7 @@ myth-job:
fdfs
:
so-timeout
:
1500
connect-timeout
:
600
http-port
:
8888
pool
:
jmx-enabled
:
false
tracker-list
:
...
...
byit-myth-core/myth-admin-core/src/main/java/com/byit/service/mapservice/impl/RunRecordingAndEmailServiceImpl.java
View file @
c5502c2f
...
...
@@ -2,7 +2,6 @@ package com.byit.service.mapservice.impl;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.date.DateUtil
;
import
com.byit.filesystem.FileSystem
;
import
com.byit.model.EmailAlarm
;
import
com.byit.model.JobTaskRunLogWithBLOBs
;
import
com.byit.model.RunRecording
;
...
...
@@ -13,10 +12,9 @@ import com.byit.service.mapservice.RunRecordingAndEmailService;
import
com.byit.util.TimeFormatUtil
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
import
java.io.IOException
;
import
java.nio.charset.StandardCharsets
;
import
java.util.List
;
/**
...
...
@@ -35,19 +33,19 @@ public class RunRecordingAndEmailServiceImpl implements RunRecordingAndEmailServ
*/
private
final
JobTaskRunLogService
jobTaskRunLogService
;
/**
* 文件系统
*/
private
final
FileSystem
fileSystem
;
/**
* 运行实例操作
*/
private
final
RunRecordingService
runRecordingService
;
@Value
(
"${fdfs.tracker-list}"
)
private
List
<
String
>
trackerIps
;
@Value
(
"${fdfs.http-port}"
)
private
String
trackerIpsPort
;
public
RunRecordingAndEmailServiceImpl
(
EmailAlarmService
emailAlarmService
,
JobTaskRunLogService
jobTaskRunLogService
,
FileSystem
fileSystem
,
RunRecordingService
runRecordingService
)
{
RunRecordingService
runRecordingService
)
{
this
.
emailAlarmService
=
emailAlarmService
;
this
.
jobTaskRunLogService
=
jobTaskRunLogService
;
this
.
fileSystem
=
fileSystem
;
this
.
runRecordingService
=
runRecordingService
;
}
...
...
@@ -91,7 +89,7 @@ public class RunRecordingAndEmailServiceImpl implements RunRecordingAndEmailServ
.
append
(
"<th width = '10%'>结束时间</th>"
)
.
append
(
"<th width = '10%'>耗费时间</th>"
)
.
append
(
"<th width = '10%'>运行结果</th>"
)
.
append
(
"<th width = '50%'>
运行日志
</th>"
)
.
append
(
"<th width = '50%'>
日志远程路径
</th>"
)
.
append
(
"</thead>"
)
.
append
(
"<tbody>"
);
...
...
@@ -103,19 +101,18 @@ public class RunRecordingAndEmailServiceImpl implements RunRecordingAndEmailServ
* String logFilePath = FILE_SYSTEM_PRE+fileSystemIp+":"+fileSystemPort+"/"+jobTaskRunLog.getLogRemotelyPath();
* String logFileUrl = String.format(iframeHtml,logFilePath);
*/
String
logStr
=
null
;
try
{
String
logStr
=
"无远程路径"
;
if
(
StringUtils
.
isNotBlank
(
jobTaskRunLog
.
getLogRemotelyPath
())){
logStr
=
new
String
(
fileSystem
.
downloaderFile
(
jobTaskRunLog
.
getLogRemotelyPath
()),
StandardCharsets
.
UTF_8
);
}
else
if
(
StringUtils
.
isNotBlank
(
jobTaskRunLog
.
getRunMsg
()
))
{
logStr
=
jobTaskRunLog
.
getRunMsg
();
}
else
if
(
StringUtils
.
isNotBlank
(
jobTaskRunLog
.
getTriggerMsg
())){
logStr
=
jobTaskRunLog
.
getTriggerMsg
()
;
}
else
{
logStr
=
"未知异常,出现此错误属于系统错误,请联系myth-job-admin开发团队!"
;
logStr
=
jobTaskRunLog
.
getLogRemotelyPath
(
);
if
(
CollectionUtil
.
isNotEmpty
(
trackerIps
))
{
for
(
String
ipPort
:
trackerIps
)
{
String
ip
=
ipPort
.
split
(
":"
)[
0
];
String
baseUrl
=
"http://"
+
ip
+
":"
+
trackerIpsPort
+
"/"
;
logStr
=
baseUrl
+
logStr
+
"\n"
;
log
.
debug
(
"--------log远程路径为:{}------"
,
logStr
)
;
}
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
stringBuilder
.
append
(
"<tr align='center'>"
)
.
append
(
String
.
format
(
"<td>%s</td>"
,
jobTaskRunLog
.
getNodeName
()))
...
...
@@ -127,7 +124,7 @@ public class RunRecordingAndEmailServiceImpl implements RunRecordingAndEmailServ
:
"4"
.
equals
(
jobTaskRunLog
.
getRunCode
())
?
"补批失败"
:
"失败"
))
.
append
(
"<td>"
)
.
append
(
"<div style='display:inline-block;width:100%;word-break:break-all;height: auto;overflow: auto;text-align: left;'>"
)
.
append
(
String
.
format
(
"%s"
,
logStr
==
null
?
jobTaskRunLog
.
getRunMsg
():
logStr
))
.
append
(
String
.
format
(
"%s"
,
logStr
))
.
append
(
"</div>"
)
.
append
(
"</td></tr>"
);
...
...
byit-myth-core/myth-admin-core/src/main/java/com/byit/thread/helper/EndAndNotWarningThreadRunHelper.java
View file @
c5502c2f
...
...
@@ -7,6 +7,7 @@ import com.byit.service.RunRecordingService;
import
com.byit.service.mapservice.RunRecordingAndEmailService
;
import
com.byit.thread.BaseThreadRunHelper
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
import
javax.sql.DataSource
;
...
...
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