From 8c26b006fbb26456789d0433c9f9c30cd445ae57 Mon Sep 17 00:00:00 2001 From: youys <1272586223@qq.com> Date: Thu, 7 Apr 2022 16:53:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../net/educoder/controller/CallbackController.java | 10 +++++----- .../net/educoder/schedule/EvaCheckWarningTask.java | 3 +-- 2 files changed, 6 insertions(+), 7 deletions(-) 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)) {