فهرست منبع

增加定时任务报警

xueyiming 11 ماه پیش
والد
کامیت
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;
     }