提交 b2cb839a 作者: 洪东保

转录文件为空或者太短直接不重试

父级 06afcce4
......@@ -228,29 +228,37 @@ public class FileProcessTask {
processLogService.log(meetingId,subMeetingId,meetingRecordId + sw.toString());
// 异常处理
retryCount++;
if (retryCount > MAX_RETRY) {
log.error("达到最大重试次数:meetingId {}", meetingId);
//如果是兜底重试,最终还是失败了,设置会议的重试状态为已重试
if (finalRetry) {
meetingInfoMapper.update(null,
new LambdaUpdateWrapper<MeetingInfo>()
.eq(MeetingInfo::getMeetingRecordId, meetingRecordId)
.set(MeetingInfo::getStatus, status != null ? status : MeetingState.GENERATE_ERROR.getCode())
.set(MeetingInfo::getGenerateRetry,Boolean.TRUE));
} else {
meetingInfoMapper.update(null,
new LambdaUpdateWrapper<MeetingInfo>()
.eq(MeetingInfo::getMeetingRecordId, meetingRecordId)
.set(MeetingInfo::getStatus, status != null ? status : MeetingState.GENERATE_ERROR.getCode())
);
}
if (status != null && status == MeetingState.EMPTY.getCode()) {
meetingInfoMapper.update(null,
new LambdaUpdateWrapper<MeetingInfo>()
.eq(MeetingInfo::getMeetingRecordId, meetingRecordId)
.set(MeetingInfo::getStatus, status));
break;
} else {
// 指数退避
try {
Thread.sleep((long) Math.pow(2, retryCount) * 1000);
} catch (InterruptedException ie) {
Thread.currentThread().interrupt();
throw new RuntimeException("重试失败", ie);
if (retryCount > MAX_RETRY) {
log.error("达到最大重试次数:meetingId {}", meetingId);
//如果是兜底重试,最终还是失败了,设置会议的重试状态为已重试
if (finalRetry) {
meetingInfoMapper.update(null,
new LambdaUpdateWrapper<MeetingInfo>()
.eq(MeetingInfo::getMeetingRecordId, meetingRecordId)
.set(MeetingInfo::getStatus, status != null ? status : MeetingState.GENERATE_ERROR.getCode())
.set(MeetingInfo::getGenerateRetry, Boolean.TRUE));
} else {
meetingInfoMapper.update(null,
new LambdaUpdateWrapper<MeetingInfo>()
.eq(MeetingInfo::getMeetingRecordId, meetingRecordId)
.set(MeetingInfo::getStatus, status != null ? status : MeetingState.GENERATE_ERROR.getCode())
);
}
} else {
// 指数退避
try {
Thread.sleep((long) Math.pow(2, retryCount) * 1000);
} catch (InterruptedException ie) {
Thread.currentThread().interrupt();
throw new RuntimeException("重试失败", ie);
}
}
}
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论