master
youys 3 years ago
parent 1abf49742d
commit 8c26b006fb

@ -40,7 +40,7 @@ public class CallbackController {
public String evaluation(@RequestParam Map<String, Object> params) { public String evaluation(@RequestParam Map<String, Object> params) {
log.info("回调请求参数:{}", params); log.info("回调请求参数:{}", params);
if (params == null) { if (params == null || params.get("jsonTestDetails") == null) {
return RESULT; return RESULT;
} }
@ -53,10 +53,8 @@ public class CallbackController {
long incr; long incr;
String incrKey = String.format("evaluationResult:%s", tpiID); String incrKey = String.format("evaluationResult:%s", tpiID);
boolean flag = (incr = redisUtil.increment(incrKey)) > 3; if (matchOutPut(decodeOutPut) && (incr = redisUtil.increment(incrKey)) > 3) {
log.info("evaluationResult, tpiID:{},第{}次评测失败", tpiID, incr); log.info("evaluationResult, tpiID:{},第{}次评测失败,需要发送钉钉通知", tpiID, incr);
if (matchOutPut(decodeOutPut) && flag) {
log.info("tpiID:{},需要发送钉钉通知", tpiID);
// 钉钉通知 // 钉钉通知
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
sb.append("【自动化评测】tpiID:").append(tpiID).append(" 错误:消息").append(decodeOutPut); sb.append("【自动化评测】tpiID:").append(tpiID).append(" 错误:消息").append(decodeOutPut);
@ -65,7 +63,9 @@ public class CallbackController {
// 通知之后清空 // 通知之后清空
redisUtil.remove(incrKey); redisUtil.remove(incrKey);
return RESULT;
} }
log.info("tpiID:{},评测通过", tpiID);
return RESULT; return RESULT;
} }

@ -42,8 +42,7 @@ public class EvaCheckWarningTask {
long startTime = System.currentTimeMillis(); long startTime = System.currentTimeMillis();
List<AutoEvaParamConfig> autoEvaParamConfigList = autoEvaParamConfigService.findAll(); List<AutoEvaParamConfig> autoEvaParamConfigList = autoEvaParamConfigService.findAll();
log.info(JSONObject.toJSONString(autoEvaParamConfigList)); log.info("自动化评测接口告警检查,总共有[{}]条需要评测", autoEvaParamConfigList.size());
for (AutoEvaParamConfig autoEvaParamConfig : autoEvaParamConfigList) { for (AutoEvaParamConfig autoEvaParamConfig : autoEvaParamConfigList) {
try { try {
if (autoEvaParamConfig.getType().equals(AutoEvaParamConfig.SX_EVA)) { if (autoEvaParamConfig.getType().equals(AutoEvaParamConfig.SX_EVA)) {

Loading…
Cancel
Save