Browse Source

bug修复

master
luogw 1 month ago
parent
commit
508e9722de
  1. 8
      src/main/java/com/project/interaction/utils/NotifyUtil.java

8
src/main/java/com/project/interaction/utils/NotifyUtil.java

@ -26,10 +26,10 @@ public class NotifyUtil {
private RedissonClient redissonClient; private RedissonClient redissonClient;
// 钉钉通知相关配置 // 钉钉通知相关配置
private static final List<String> WARN_USER_LIST = Lists.newArrayList( private final List<String> WARN_USER_LIST = Lists.newArrayList(
"283712335120874575", "283712335120874575",
"01231011386731976125", "01231011386731976125",
"5902043009320002110" "590204300932000212"
); );
// 防重复缓存key前缀 // 防重复缓存key前缀
private static final String WARN_LOCK_KEY_PREFIX = "question:gen:warn:lock:"; private static final String WARN_LOCK_KEY_PREFIX = "question:gen:warn:lock:";
@ -55,7 +55,7 @@ public class NotifyUtil {
String.format("## 核心信息\n") + String.format("## 核心信息\n") +
String.format("- 考试任务ID:%d\n", taskId) + String.format("- 考试任务ID:%d\n", taskId) +
String.format("- 知识点簇ID:%d\n", clusterId) + String.format("- 知识点簇ID:%d\n", clusterId) +
String.format("- 当前时间:%d\n\n", now) + String.format("- 当前时间:%s\n\n", now) +
String.format("## 异常说明\n") + String.format("## 异常说明\n") +
String.format("算法服务生成题目时调用失败,可能导致考试题目不完整或无法正常作答,请尽快排查以下问题:\n") + String.format("算法服务生成题目时调用失败,可能导致考试题目不完整或无法正常作答,请尽快排查以下问题:\n") +
String.format("- 算法服务是否正常运行\n"); String.format("- 算法服务是否正常运行\n");
@ -70,11 +70,11 @@ public class NotifyUtil {
DtCorpConversationMsgSendResult result = dtService.getCorpConversationMsgService().send(corpConversationMessage); DtCorpConversationMsgSendResult result = dtService.getCorpConversationMsgService().send(corpConversationMessage);
if (result.getErrCode() == 0) { if (result.getErrCode() == 0) {
log.info(">>> [算法生题API调用失败通知] 成功发送通知 ,考试任务ID:{} ,知识点簇ID:{}", taskId, clusterId); log.info(">>> [算法生题API调用失败通知] 成功发送通知 ,考试任务ID:{} ,知识点簇ID:{}", taskId, clusterId);
redissonClient.getBucket(cacheKey).set("SEND_SUCCESS", WARN_LOCK_EXPIRE_SECONDS, TimeUnit.SECONDS);
} else { } else {
log.error(">>> [算法生题API调用失败通知] 发送失败.考试任务ID:{} ,知识点簇ID:{}, 错误码: {}, 错误信息: {}", taskId, clusterId, log.error(">>> [算法生题API调用失败通知] 发送失败.考试任务ID:{} ,知识点簇ID:{}, 错误码: {}, 错误信息: {}", taskId, clusterId,
result.getErrCode(), result.getErrMsg()); result.getErrCode(), result.getErrMsg());
} }
redissonClient.getBucket(cacheKey).set("SEND_SUCCESS", WARN_LOCK_EXPIRE_SECONDS, TimeUnit.SECONDS);
} catch (Exception e) { } catch (Exception e) {
log.error(">>> [算法生题API调用失败通知] 钉钉接口调用异常, 考试任务ID:{} ,知识点簇ID:{}, 原因: {}",taskId, clusterId, e.getMessage()); log.error(">>> [算法生题API调用失败通知] 钉钉接口调用异常, 考试任务ID:{} ,知识点簇ID:{}, 原因: {}",taskId, clusterId, e.getMessage());

Loading…
Cancel
Save