diff --git a/src/main/java/net/educoder/controller/CallbackController.java b/src/main/java/net/educoder/controller/CallbackController.java index e20f9a8..644e050 100644 --- a/src/main/java/net/educoder/controller/CallbackController.java +++ b/src/main/java/net/educoder/controller/CallbackController.java @@ -40,7 +40,7 @@ public class CallbackController { public String evaluation(@RequestParam Map params) { log.info("回调请求参数:{}", params); - if (params == null) { + if (params == null || params.get("jsonTestDetails") == null) { return RESULT; } @@ -53,10 +53,8 @@ public class CallbackController { long incr; String incrKey = String.format("evaluationResult:%s", tpiID); - boolean flag = (incr = redisUtil.increment(incrKey)) > 3; - log.info("evaluationResult, tpiID:{},第{}次评测失败", tpiID, incr); - if (matchOutPut(decodeOutPut) && flag) { - log.info("tpiID:{},需要发送钉钉通知", tpiID); + if (matchOutPut(decodeOutPut) && (incr = redisUtil.increment(incrKey)) > 3) { + log.info("evaluationResult, tpiID:{},第{}次评测失败,需要发送钉钉通知", tpiID, incr); // 钉钉通知 StringBuilder sb = new StringBuilder(); sb.append("【自动化评测】tpiID:").append(tpiID).append(" 错误:消息").append(decodeOutPut); @@ -65,7 +63,9 @@ public class CallbackController { // 通知之后清空 redisUtil.remove(incrKey); + return RESULT; } + log.info("tpiID:{},评测通过", tpiID); return RESULT; } diff --git a/src/main/java/net/educoder/schedule/EvaCheckWarningTask.java b/src/main/java/net/educoder/schedule/EvaCheckWarningTask.java index cdcf11e..164109d 100644 --- a/src/main/java/net/educoder/schedule/EvaCheckWarningTask.java +++ b/src/main/java/net/educoder/schedule/EvaCheckWarningTask.java @@ -42,8 +42,7 @@ public class EvaCheckWarningTask { long startTime = System.currentTimeMillis(); List autoEvaParamConfigList = autoEvaParamConfigService.findAll(); - log.info(JSONObject.toJSONString(autoEvaParamConfigList)); - + log.info("自动化评测接口告警检查,总共有[{}]条需要评测", autoEvaParamConfigList.size()); for (AutoEvaParamConfig autoEvaParamConfig : autoEvaParamConfigList) { try { if (autoEvaParamConfig.getType().equals(AutoEvaParamConfig.SX_EVA)) {