Преглед на файлове

修改超时重试逻辑

xueyiming преди 7 месеца
родител
ревизия
fbf1915d80
променени са 1 файла, в които са добавени 13 реда и са изтрити 8 реда
  1. 13 8
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/local/impl/CoreServiceImpl.java

+ 13 - 8
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/local/impl/CoreServiceImpl.java

@@ -713,16 +713,21 @@ public class CoreServiceImpl implements CoreService {
                 long createTimestamp = entry.getValue().get(0).getCreateTime().getTime();
                 long nowTimestamp = System.currentTimeMillis();
                 if (nowTimestamp - createTimestamp > TimeConstant.MILLISECOND_HOUR * 2) {
-                    PublishContentExample publishContentExample = new PublishContentExample();
-                    publishContentExample.createCriteria().andPushIdEqualTo(pushId);
-                    PublishContent update = new PublishContent();
                     if (StringUtils.isNotEmpty(pushStatusVO.getErrorMsg())) {
-                        update.setReason(pushStatusVO.getErrorMsg());
+                        PublishContentExample publishContentExample = new PublishContentExample();
+                        publishContentExample.createCriteria().andPushIdEqualTo(pushId);
+                        PublishContent update = new PublishContent();
+                        if (StringUtils.isNotEmpty(pushStatusVO.getErrorMsg())) {
+                            update.setReason(pushStatusVO.getErrorMsg());
+                        }
+                        update.setStatus(3);
+                        publishContentMapper.updateByExampleSelective(update, publishContentExample);
+                        planAccountService.updateRetry(planAccount);
+                        LarkRobotUtil.sendMessage("重试超过2h失败,pushId=", pushId);
+                    } else {
+                        long hour = (nowTimestamp - createTimestamp) / 1000 / 3600;
+                        LarkRobotUtil.sendMessage("重试时间:" + hour + "pushId=", pushId);
                     }
-                    update.setStatus(3);
-                    publishContentMapper.updateByExampleSelective(update, publishContentExample);
-                    planAccountService.updateRetry(planAccount);
-                    LarkRobotUtil.sendMessage("重试超过2h失败,pushId=", pushId);
                 }
             }
             if (StringUtils.isNotEmpty(pushStatusVO.getErrorMsg()) && !pushStatusVO.getErrorMsg().contains("45028")) {