瀏覽代碼

增加定时任务报警

xueyiming 7 月之前
父節點
當前提交
c26558410b
共有 1 個文件被更改,包括 25 次插入4 次删除
  1. 25 4
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/job/PlanAccountJob.java

+ 25 - 4
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/job/PlanAccountJob.java

@@ -1,6 +1,7 @@
 package com.tzld.piaoquan.longarticle.job;
 
 import com.tzld.piaoquan.longarticle.service.local.impl.CoreServiceImpl;
+import com.tzld.piaoquan.longarticle.utils.LarkRobotUtil;
 import com.xxl.job.core.biz.model.ReturnT;
 import com.xxl.job.core.handler.annotation.XxlJob;
 import lombok.extern.slf4j.Slf4j;
@@ -17,25 +18,45 @@ public class PlanAccountJob {
 
     @XxlJob("initPlanAccountJob")
     public ReturnT<String> initPlanAccount(String param) {
-        coreService.initPlanAccount();
+        try {
+            coreService.initPlanAccount();
+        }catch (Exception e){
+            LarkRobotUtil.sendMessage("长文系统初始化异常,请及时查看,@薛一鸣");
+            log.error("initPlanAccountJob error", e);
+        }
         return ReturnT.SUCCESS;
     }
 
     @XxlJob("matchPlanAccountJob")
     public ReturnT<String> matchPlanAccount(String param) {
-        coreService.matchContent();
+        try {
+            coreService.matchContent();
+        }catch (Exception e){
+            LarkRobotUtil.sendMessage("长文系统匹配异常,请及时查看,@薛一鸣");
+            log.error("matchPlanAccountJob error", e);
+        }
         return ReturnT.SUCCESS;
     }
 
     @XxlJob("corePlanAccountJob")
     public ReturnT<String> corePlanAccount(String param) {
-        coreService.core();
+        try {
+            coreService.core();
+        }catch (Exception e){
+            LarkRobotUtil.sendMessage("长文系统核心流程异常,请及时查看,@薛一鸣");
+            log.error("corePlanAccountJob error", e);
+        }
         return ReturnT.SUCCESS;
     }
 
     @XxlJob("getPushStatusJob")
     public ReturnT<String> getPushStatus(String param) {
-        coreService.getPushStatus();
+        try {
+            coreService.getPushStatus();
+        }catch (Exception e){
+            LarkRobotUtil.sendMessage("长文系统获取结果异常,请及时查看,@薛一鸣");
+            log.error("getPushStatusJob error", e);
+        }
         return ReturnT.SUCCESS;
     }