Переглянути джерело

分组群发增加重试次数

wangyunpeng 4 тижнів тому
батько
коміт
b55b4c810f

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

@@ -581,8 +581,17 @@ public class CoreServiceImpl implements CoreService {
             if (sendCount >= 1) {
                 return false;
             }
-            //公众号群发每天最多尝试3次
-            if (planAccount.getRetryCount() >= 3) {
+            if ((fwhGhIdList != null && fwhGhIdList.contains(planAccount.getGhId()))
+                    || (Objects.equals(planAccount.getPushType(), PublishGzhPushTypeEnum.batch_group_publish.getVal()))) {
+                // 服务号分组求发每天最多尝试10次
+                if (planAccount.getRetryCount() >= 10) {
+                    planAccount.setStatus(3);
+                    planAccountMapper.updateByPrimaryKeySelective(planAccount);
+                    LarkRobotUtil.sendMessage("计划发布失败3次,请查看 账号计划id为" + planAccount.getPlanId());
+                    return false;
+                }
+            } else if (planAccount.getRetryCount() >= 3) {
+                // 公众号群发每天最多尝试3次
                 planAccount.setStatus(3);
                 planAccountMapper.updateByPrimaryKeySelective(planAccount);
                 LarkRobotUtil.sendMessage("计划发布失败3次,请查看 账号计划id为" + planAccount.getPlanId());
@@ -1094,7 +1103,9 @@ public class CoreServiceImpl implements CoreService {
                     }
                 }
             }
-            if (StringUtils.isNotEmpty(pushStatusVO.getErrorMsg()) && !pushStatusVO.getErrorMsg().contains("45028")) {
+            if (StringUtils.isNotEmpty(pushStatusVO.getErrorMsg())
+                    && !pushStatusVO.getErrorMsg().contains("45028")
+                    && !pushStatusVO.getErrorMsg().contains("所有分组均发表失败")) {
                 log.error("push error pushId={} msg={}", pushId, pushStatusVO.getErrorMsg());
                 String message = String.format("发布失败,请查看,pushId=%s 失败信息:%s 账号名称:%s 计划名称:%s",
                         pushId, pushStatusVO.getErrorMsg(), planAccount.getAccountName(), planAccount.getPlanName());