You've already forked FrameTour-BE
fix(task): 修复任务重复处理中的日志和更新逻辑
- 移除了创建任务日志中的敏感参数信息 - 更新重复任务日志以包含任务ID信息 - 移除了workerId重置逻辑,改为显式清除方法 - 修复TaskMapper中status字段的SQL语法问题 - 优化了任务参数更新的处理流程
This commit is contained in:
@@ -399,7 +399,7 @@ public class TaskTaskServiceImpl implements TaskService {
|
||||
memberVideoEntity.setTemplateId(templateId);
|
||||
memberVideoEntity.setIsBuy(0);
|
||||
if (list.isEmpty()) {
|
||||
log.info("创建任务! faceId:{},templateId:{},taskParams:{}", faceId, templateId, sourcesMap);
|
||||
log.info("创建任务! faceId:{},templateId:{}", faceId, templateId);
|
||||
ScenicConfigManager scenicConfig = scenicRepository.getScenicConfigManager(face.getScenicId());
|
||||
TaskEntity taskEntity = null;
|
||||
boolean isReuseOldTask = false;
|
||||
@@ -439,15 +439,16 @@ public class TaskTaskServiceImpl implements TaskService {
|
||||
}
|
||||
memberVideoEntity.setTaskId(taskEntity.getId());
|
||||
} else {
|
||||
log.info("重复task,更新旧任务! faceId:{},templateId:{},taskParams:{}", faceId, templateId, sourcesMap);
|
||||
TaskRespVO existingTask = list.getFirst();
|
||||
// 更新旧任务:重置workerId为空,status为0,更新taskParams
|
||||
log.info("重复task,更新旧任务! faceId:{},templateId:{},taskId:{}", faceId, templateId, existingTask.getId());
|
||||
// 更新旧任务:重置status为0,更新taskParams
|
||||
TaskEntity taskUpdate = new TaskEntity();
|
||||
taskUpdate.setId(existingTask.getId());
|
||||
taskUpdate.setWorkerId(null);
|
||||
taskUpdate.setStatus(0);
|
||||
taskUpdate.setTaskParams(JacksonUtil.toJSONString(sourcesMap));
|
||||
taskMapper.update(taskUpdate);
|
||||
// 显式清除workerId(update方法的动态SQL会跳过null值)
|
||||
taskMapper.deassign(existingTask.getId());
|
||||
videoTaskRepository.clearTaskCache(existingTask.getId());
|
||||
|
||||
memberVideoEntity.setTaskId(existingTask.getId());
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<if test="scenicId!= null">scenic_id = #{scenicId}, </if>
|
||||
<if test="taskParams!= null">task_params = #{taskParams}, </if>
|
||||
<if test="videoUrl!= null">video_url = #{videoUrl}, </if>
|
||||
<if test="status!= null">status = #{status}, </if>
|
||||
<if test="status!= null">`status` = #{status}, </if>
|
||||
<if test="result!= null">result = #{result}, </if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
|
||||
Reference in New Issue
Block a user