Commit 01ee08de by guominglei

Merge remote-tracking branch 'origin/developer' into developer

parents fb4752af 93498e54
......@@ -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();
......
......@@ -59,7 +59,14 @@ public class MakeUpFlowThreadRunHelper extends BaseThreadRunHelper {
nextRunFlow.forEach((key,value) ->{
/*保证数据为串行*/
try {
Thread.sleep(100);
} catch (InterruptedException e) {
e.printStackTrace();
}
boolean runRecordingIsRunning = runRecordingService.findRunRecordingIsRunning(value.getFlowId());
log.info("-------{}的运行状态为{}",value,runRecordingIsRunning);
if(!runRecordingIsRunning){
runRecordingAndJobTaskService.updateRunRecordingAndTask(value);
}
......
......@@ -88,7 +88,13 @@ public class MythJobProcess implements Callable<String>{
@SneakyThrows
@Override
public String call() {
RunLog startRunLog = RunLog.builder().isEnd(false).runLog("start").build();
//stringRedisTemplate.convertAndSend(runKey, JSON.toJSONString(runLog, WriteClassName))
//TODO 向队尾追加一个日志
Long startLong = stringRedisTemplate.opsForList().rightPush(runKey , JSON.toJSONString(startRunLog, WriteClassName));
if(startLong <= 0){
log.error("------日志信息加入redis异常,{}---------",startLong);
}
//判断是否执行过
if (this.isStarted() || this.isComplete()) {
throw new IllegalStateException("该过程只能使用一次");
......
......@@ -46,7 +46,8 @@ public class LogGobbler extends Thread {
runLog.setRunLog(line);
//stringRedisTemplate.convertAndSend(runKey, JSON.toJSONString(runLog, WriteClassName))
//TODO 向队列队尾插入一个值
stringRedisTemplate.opsForList().rightPush(runKey , JSON.toJSONString(runLog, WriteClassName));
Long aLong = stringRedisTemplate.opsForList().rightPush(runKey, JSON.toJSONString(runLog, WriteClassName));
log.info("-------{}-------",aLong);
printLog(line);
}
} catch (final IOException e) {
......
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