소스 검색

增加报警

xueyiming 1 년 전
부모
커밋
54145a5688
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/XxlJobService.java

+ 3 - 0
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/XxlJobService.java

@@ -318,6 +318,9 @@ public class XxlJobService {
         ytdExample.createCriteria().andCreateTimeBetween(new Date(ytdStartTimestamp), new Date(ytdEndTimestamp));
         ytdExample.createCriteria().andCreateTimeBetween(new Date(ytdStartTimestamp), new Date(ytdEndTimestamp));
         long ydtCount = pushMessageCallbackMapper.countByExample(example);
         long ydtCount = pushMessageCallbackMapper.countByExample(example);
         if (nowCount + 1000 < ydtCount) {
         if (nowCount + 1000 < ydtCount) {
+            if (ydtCount == 0) {
+                ydtCount = 1L;
+            }
             double res = ((double) nowCount - ydtCount) * 100 / ydtCount;
             double res = ((double) nowCount - ydtCount) * 100 / ydtCount;
             LarkRobotUtil.sendMessage("最近一小时回调消息量:" + nowCount + "\n"
             LarkRobotUtil.sendMessage("最近一小时回调消息量:" + nowCount + "\n"
                     + "昨日消息回调量:" + ydtCount + "\n"
                     + "昨日消息回调量:" + ydtCount + "\n"