Browse Source

feat:添加异常日志

zhaohaipeng 2 weeks ago
parent
commit
76f6ba0ce0

+ 1 - 1
recommend-server-service/src/main/java/com/tzld/piaoquan/recommend/server/feign/FlowPoolFeign.java

@@ -16,5 +16,5 @@ public interface FlowPoolFeign {
     FlowPoolResponse<List<FlowPoolVideoInfo>> getFlowPoolVideo(@RequestBody JSONObject param);
 
     @PostMapping("/flowpool/video/remainViewCount")
-    FlowPoolResponse<List<FlowPoolVideoInfo>> remainViewCount(@RequestBody List<JSONObject> param);
+    FlowPoolResponse<List<FlowPoolVideoInfo>> remainViewCount(@RequestBody JSONObject param);
 }

+ 4 - 2
recommend-server-service/src/main/java/com/tzld/piaoquan/recommend/server/service/flowpool/FlowPoolService.java

@@ -300,8 +300,10 @@ public class FlowPoolService {
 
         List<FlowPoolVideoInfo> remainFlowPoolVideoInfos = new ArrayList<>(flowPoolVideoInfos.size());
         List<List<JSONObject>> partition = Lists.partition(paramJsonList, 10);
-        for (List<JSONObject> param : partition) {
-            FlowPoolResponse<List<FlowPoolVideoInfo>> response = flowPoolFeign.remainViewCount(param);
+        for (List<JSONObject> videos : partition) {
+            JSONObject paramJson = new JSONObject();
+            paramJson.put("videos", videos);
+            FlowPoolResponse<List<FlowPoolVideoInfo>> response = flowPoolFeign.remainViewCount(paramJson);
             if (0 != response.getCode()) {
                 log.error("[remain view count error] responseJson: {}", response);
                 continue;

+ 5 - 1
recommend-server-service/src/main/java/com/tzld/piaoquan/recommend/server/xxl/FlowPoolJob.java

@@ -17,7 +17,11 @@ public class FlowPoolJob {
 
     @XxlJob("syncDouHotFlowPoolVideo")
     public ReturnT<String> syncDouHotFlowPoolVideo(String params) {
-        flowPoolService.syncDouHotFlowPoolVideo();
+        try {
+            flowPoolService.syncDouHotFlowPoolVideo();
+        }catch (Exception e){
+            log.error("[syncDouHotFlowPoolVideo error]", e);
+        }
         return ReturnT.SUCCESS;
     }
 }