Commit 3f9f6664 by huangfusuper

完善日志信息

parent 54dd1ba0
......@@ -105,13 +105,17 @@ public class ApiNodeServiceImpl implements ApiNodeService {
Integer logId= jobTaskRunLog.getLogId();
//设置日志id
schedule.setLogId(logId);
TimerTask timerTask = new ScriptExecutorJobTask(schedule);
WorkRoulette.addJob(timerTask, triggerTime);
RunLog runLog = RunLog.builder().isEnd(false).runLog("等待服务器分配资源").build();
String runKey = "REAL:EXEC:" + logId;
stringRedisTemplate.opsForList().rightPush(runKey, JSON.toJSONString(runLog, WriteClassName));
TimerTask timerTask = new ScriptExecutorJobTask(schedule);
WorkRoulette.addJob(timerTask, triggerTime);
RunLog runLogEnd = RunLog.builder().isEnd(false).runLog("服务器分配资源成功").build();
stringRedisTemplate.opsForList().rightPush(runKey, JSON.toJSONString(runLogEnd, WriteClassName));
return runKey;
}
......
......@@ -120,6 +120,13 @@ public class MythJobProcess implements Callable<String>{
log.info("进程的id " + this.processId);
}
if (stringRedisTemplate != null) {
RunLog runLog = RunLog.builder().isEnd(false).runLog("开始执行").build();
//TODO 向队列队尾插入一个值
Long aLong = stringRedisTemplate.opsForList().rightPush(runKey, JSON.toJSONString(runLog, WriteClassName));
log.info("-------{}-------",aLong);
}
outputGobbler = new LogGobbler(new InputStreamReader(this.process.getInputStream(), "utf-8"), Boolean.FALSE, 30, runKey, stringRedisTemplate);
errorGobbler = new LogGobbler(new InputStreamReader(this.process.getErrorStream(), "utf-8"), Boolean.TRUE, 30, runKey, stringRedisTemplate);
//开始获取进程的运行日志
......
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