Commit 3b9c2194 by huangfusuper

解决远程日志信息出错的情况

parent c54e80bc
......@@ -12,6 +12,7 @@ import com.byit.service.RunRecordingService;
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.stereotype.Component;
import java.io.IOException;
......@@ -104,8 +105,14 @@ public class RunRecordingAndEmailServiceImpl implements RunRecordingAndEmailServ
*/
String logStr = null;
try {
if(null != jobTaskRunLog.getLogRemotelyPath()){
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开发团队!";
}
} catch (IOException e) {
e.printStackTrace();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment