Commit 6447479d authored by litengwei's avatar litengwei

中心检测问题修复

parent fd5cd3e4
...@@ -62,8 +62,6 @@ public class RuleRunigSnapshotServiceImpl ...@@ -62,8 +62,6 @@ public class RuleRunigSnapshotServiceImpl
static ObjectMapper objectMapper; static ObjectMapper objectMapper;
private final Logger logger = LoggerFactory.getLogger(RuleRunigSnapshotServiceImpl.class);
@Autowired @Autowired
private RedisTemplate redisTemplate; private RedisTemplate redisTemplate;
...@@ -161,8 +159,6 @@ public class RuleRunigSnapshotServiceImpl ...@@ -161,8 +159,6 @@ public class RuleRunigSnapshotServiceImpl
if(!CollectionUtils.isEmpty(oldEntityList)) if(!CollectionUtils.isEmpty(oldEntityList))
{ {
logger.info("开始回放:batchNo="+batchNo);
logger.info("获取到动作记录个数:"+oldEntityList.size());
redisTemplate.opsForValue().set("replay:" + batchNo +":" + randomNumber, true); redisTemplate.opsForValue().set("replay:" + batchNo +":" + randomNumber, true);
int count = 0; int count = 0;
for(RuleRuningSnapshot snapshot : oldEntityList) for(RuleRuningSnapshot snapshot : oldEntityList)
...@@ -188,28 +184,21 @@ public class RuleRunigSnapshotServiceImpl ...@@ -188,28 +184,21 @@ public class RuleRunigSnapshotServiceImpl
return; return;
} }
//延迟 //延迟
logger.info("开始执行第"+(++count)+"个动作.");
logger.info("方法名:"+snapshot.getMethodClass()+"."+snapshot.getMethodName());
logger.info("需要延迟"+snapshot.getPreviousInterval()+"毫秒.......");
Thread.sleep(snapshot.getPreviousInterval()); Thread.sleep(snapshot.getPreviousInterval());
try try
{ {
webMqttComponent.publish(String.format("%s/%s/%s", snapshot.getPackageId(), "replay", randomNumber) , snapshot.getMethodParam()); webMqttComponent.publish(String.format("%s/%s/%s", snapshot.getPackageId(), "replay", randomNumber) , snapshot.getMethodParam());
logger.info("第"+(count)+"个动作执行成功.");
}catch (Exception e) }catch (Exception e)
{ {
logger.info("第"+(count)+"个动作执行失败.");
e.printStackTrace(); e.printStackTrace();
logger.error(e.getMessage(),e);
} }
} }
} }
}catch (Exception e) }catch (Exception e)
{ {
logger.info("回放失败."); e.printStackTrace();
logger.error(e.getMessage(),e);
} finally { } finally {
redisTemplate.delete("replay:" + batchNo +":" + randomNumber); redisTemplate.delete("replay:" + batchNo +":" + randomNumber);
} }
...@@ -235,8 +224,6 @@ public class RuleRunigSnapshotServiceImpl ...@@ -235,8 +224,6 @@ public class RuleRunigSnapshotServiceImpl
if(!CollectionUtils.isEmpty(oldEntityList)) if(!CollectionUtils.isEmpty(oldEntityList))
{ {
logger.info("开始回放:batchNo="+batchNo);
logger.info("获取到动作记录个数:"+oldEntityList.size());
int count = 0; int count = 0;
for(RuleRuningSnapshot snapshot : oldEntityList) for(RuleRuningSnapshot snapshot : oldEntityList)
...@@ -245,9 +232,6 @@ public class RuleRunigSnapshotServiceImpl ...@@ -245,9 +232,6 @@ public class RuleRunigSnapshotServiceImpl
return ; return ;
//延迟 //延迟
logger.info("开始执行第"+(++count)+"个动作.");
logger.info("方法名:"+snapshot.getMethodClass()+"."+snapshot.getMethodName());
logger.info("需要延迟"+snapshot.getPreviousInterval()+"毫秒.......");
Thread.sleep(snapshot.getPreviousInterval()); Thread.sleep(snapshot.getPreviousInterval());
try try
...@@ -289,20 +273,16 @@ public class RuleRunigSnapshotServiceImpl ...@@ -289,20 +273,16 @@ public class RuleRunigSnapshotServiceImpl
method.invoke(obj); method.invoke(obj);
} }
logger.info("第"+(count)+"个动作执行成功.");
}catch (Exception e) }catch (Exception e)
{ {
logger.info("第"+(count)+"个动作执行失败.");
e.printStackTrace(); e.printStackTrace();
logger.error(e.getMessage(),e);
} }
} }
} }
}catch (Exception e) }catch (Exception e)
{ {
logger.info("回放失败."); e.printStackTrace();
logger.error(e.getMessage(),e);
}finally { }finally {
replayBatchNo = null; replayBatchNo = null;
} }
......
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