|
@@ -3,6 +3,7 @@ package com.tzld.piaoquan.longarticle.service.local.impl;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.tzld.piaoquan.longarticle.common.constants.TimeConstant;
|
|
|
import com.tzld.piaoquan.longarticle.common.enums.ContentStatusEnum;
|
|
|
import com.tzld.piaoquan.longarticle.common.enums.PublishGzhPushTypeEnum;
|
|
|
import com.tzld.piaoquan.longarticle.dao.mapper.*;
|
|
@@ -653,7 +654,7 @@ public class CoreServiceImpl implements CoreService {
|
|
|
continue;
|
|
|
}
|
|
|
int updateStatus = 0;
|
|
|
- //推送失败 失败
|
|
|
+ //推送失败
|
|
|
if (pushStatusVO.getPushStatus() == 3) {
|
|
|
updateStatus = 3;
|
|
|
}
|
|
@@ -719,13 +720,29 @@ public class CoreServiceImpl implements CoreService {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- if (StringUtils.isNotEmpty(pushStatusVO.getErrorMsg()) && !pushStatusVO.getErrorMsg().contains("45028")) {
|
|
|
- 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());
|
|
|
- LarkRobotUtil.sendMessage(message);
|
|
|
+ }
|
|
|
+ if (updateStatus == 0) {
|
|
|
+ //查询创建时间 重试超过2h 直接设置失败
|
|
|
+ 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());
|
|
|
+ }
|
|
|
+ update.setStatus(3);
|
|
|
+ publishContentMapper.updateByExampleSelective(update, publishContentExample);
|
|
|
+ LarkRobotUtil.sendMessage("重试超过2h失败,pushId=", pushId);
|
|
|
}
|
|
|
}
|
|
|
+ if (StringUtils.isNotEmpty(pushStatusVO.getErrorMsg()) && !pushStatusVO.getErrorMsg().contains("45028")) {
|
|
|
+ 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());
|
|
|
+ LarkRobotUtil.sendMessage(message);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|