You've already forked FrameTour-BE
feat(task): 添加自动替换vlog配置控制功能
- 实现scenicConfig管理器获取景区配置 - 添加auto_replace_vlog配置项,默认值为true - 当auto_replace_vlog为false时跳过自动创建任务 - 添加视频存在检查避免重复处理 - 记录跳过任务的详细日志信息
This commit is contained in:
@@ -438,6 +438,18 @@ public class TaskTaskServiceImpl implements TaskService {
|
||||
if (!templateTaskList.isEmpty()) {
|
||||
taskEntity = templateTaskList.getFirst();
|
||||
isReuseOldTask = true;
|
||||
if (automatic && !forceCreate) {
|
||||
boolean autoReplaceVlog = scenicConfig.getBoolean("auto_replace_vlog", true);
|
||||
|
||||
if (!autoReplaceVlog) {
|
||||
VideoEntity video = videoRepository.getVideoByTaskId(taskEntity.getId());
|
||||
if (video != null) {
|
||||
log.info("自动创建任务:跳过(auto_replace_vlog=false), faceId:{}, templateId:{}, existingTaskId:{}, videoId:{}",
|
||||
faceId, templateId, taskEntity.getId(), video.getId());
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
log.info("已有旧生成的视频:{}", taskEntity);
|
||||
MemberVideoEntity taskVideoRelation = videoMapper.queryRelationByMemberTask(face.getMemberId(), taskEntity.getId());
|
||||
if (taskVideoRelation != null) {
|
||||
@@ -469,6 +481,8 @@ public class TaskTaskServiceImpl implements TaskService {
|
||||
memberVideoEntity.setTaskId(taskEntity.getId());
|
||||
} else {
|
||||
TaskRespVO existingTask = list.getFirst();
|
||||
|
||||
|
||||
log.info("重复task! faceId:{},templateId:{},taskId:{}", faceId, templateId, existingTask.getId());
|
||||
videoTaskRepository.clearTaskCache(existingTask.getId());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user