|
|
@@ -42,7 +42,7 @@ public class FeishuAsyncService {
|
|
|
// 成功时需要更新docId的文档内容为已填充
|
|
|
String amountKey = FEISHU_CLIENT+docId;
|
|
|
account.setDocumentIdFillFlag(Boolean.TRUE);
|
|
|
- redisCache.setCacheObject(amountKey, account,30, TimeUnit.DAYS);
|
|
|
+ redisCache.setCacheObject(amountKey, account,3, TimeUnit.DAYS);
|
|
|
} catch (CustomException e) {
|
|
|
// 调用原Service的方法处理异常
|
|
|
Integer code = e.getCode();
|
|
|
@@ -54,9 +54,12 @@ public class FeishuAsyncService {
|
|
|
}
|
|
|
if (FeishuErrorCode.isAccountDisable(code)) {
|
|
|
feiShuService.disablePersonalAccount(account, e.getMessage());
|
|
|
- log.warn("个人账号[{}]被禁用,尝试下一个", account.getAppId());
|
|
|
+ log.warn("个人账号[{}]被禁用-", account.getAppId());
|
|
|
+ feiShuService.recordLinkError(videoId, companyId, courseId,
|
|
|
+ companyUserId, shortLink,
|
|
|
+ "账号被禁用:" + e.getMessage(), 2);
|
|
|
} else if (FeishuErrorCode.isRateLimit(code) || FeishuErrorCode.isInternalRetryable(code)) {
|
|
|
- log.warn("个人账号[{}]可重试错误,切换下一个", account.getAppId());
|
|
|
+ log.warn("个人账号[{}]可重试错误-", account.getAppId());
|
|
|
feiShuService.recordLinkError(videoId, companyId, courseId,
|
|
|
companyUserId, shortLink,
|
|
|
e.getMessage(), 1);
|
|
|
@@ -83,10 +86,12 @@ public class FeishuAsyncService {
|
|
|
// 成功时需要更新docId的课程内容为已填充
|
|
|
String amountKey = FEISHU_CLIENT+docId;
|
|
|
account.setCourseFillFlag(Boolean.TRUE);
|
|
|
- redisCache.setCacheObject(amountKey, account,30, TimeUnit.DAYS);
|
|
|
+ redisCache.setCacheObject(amountKey, account,3, TimeUnit.DAYS);
|
|
|
} catch (CustomException e) {
|
|
|
// 调用原Service的方法处理异常
|
|
|
Integer code = e.getCode();
|
|
|
+ log.error("异步填充课程失败,docId={}, videoId={}, appId={}, code={}, msg={}",
|
|
|
+ docId, videoId, account.getAppId(), code, e.getMessage(), e);
|
|
|
if (code == null) {
|
|
|
feiShuService.recordLinkError(videoId, companyId, courseId,
|
|
|
companyUserId, shortLink,
|
|
|
@@ -95,9 +100,12 @@ public class FeishuAsyncService {
|
|
|
}
|
|
|
if (FeishuErrorCode.isAccountDisable(code)) {
|
|
|
feiShuService.disablePersonalAccount(account, e.getMessage());
|
|
|
- log.warn("个人账号[{}]被禁用,尝试下一个", account.getAppId());
|
|
|
+ log.warn("个人账号[{}]被禁用", account.getAppId());
|
|
|
+ feiShuService.recordLinkError(videoId, companyId, courseId,
|
|
|
+ companyUserId, shortLink,
|
|
|
+ "账号被禁用:" + e.getMessage(), 2);
|
|
|
} else if (FeishuErrorCode.isRateLimit(code) || FeishuErrorCode.isInternalRetryable(code)) {
|
|
|
- log.warn("个人账号[{}]可重试错误,切换下一个", account.getAppId());
|
|
|
+ log.warn("个人账号[{}]可重试错误", account.getAppId());
|
|
|
feiShuService.recordLinkError(videoId, companyId, courseId,
|
|
|
companyUserId, shortLink,
|
|
|
e.getMessage(), 2);
|