Commit 611892f1 by huangfusuper

redis日志推送

parent 437bf624
......@@ -65,6 +65,12 @@ public class JavaTaskJobTask implements TimerTask {
JobTaskRunLogWithBLOBs log = new JobTaskRunLogWithBLOBs();
log.setLogId(logId);
try {
StringRedisTemplate stringRedisTemplate = (StringRedisTemplate) SpringUtil.getBean("stringRedisTemplate");
if(StringUtils.isNoneBlank(noticeKey)) {
RunLog runLog = RunLog.builder().isEnd(false).runLog("等待服务器分配资源").build();
stringRedisTemplate.opsForList().rightPush(noticeKey , JSON.toJSONString(runLog, WriteClassName));
}
PluginRpcResponsePacket pluginRpcResponsePacket = service.runJava(request);
if(pluginRpcResponsePacket.isStatus()){
log.setTriggerCode(RunResultEnum.TRIGGER_SUCCESS.getCode());
......@@ -75,8 +81,7 @@ public class JavaTaskJobTask implements TimerTask {
log.setJobGroupIp(pluginRpcResponsePacket.getRunIp());
//如果需要通知redis
if(StringUtils.isNoneBlank(noticeKey)) {
StringRedisTemplate stringRedisTemplate = (StringRedisTemplate) SpringUtil.getBean("stringRedisTemplate");
RunLog runLog = RunLog.builder().isEnd(false).isSuccess(true).runLog("资源调用成功!").build();
RunLog runLog = RunLog.builder().isEnd(false).isSuccess(true).runLog("资源分配成功!").build();
stringRedisTemplate.opsForList().rightPush(noticeKey , JSON.toJSONString(runLog, WriteClassName));
}
}catch (Exception 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