[Bug][ApiServer] When modifying the task definition, inserting the task definition log table will report the bug of primary key conflict #12037

Co-authored-by: 金鑫 <jinyanhui@huansi.net>
This commit is contained in:
金鑫 2022-09-20 14:42:21 +08:00 committed by GitHub
parent e1b55db72a
commit 649015bfff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -487,6 +487,7 @@ public class TaskDefinitionServiceImpl extends BaseServiceImpl implements TaskDe
taskDefinitionToUpdate.setOperator(loginUser.getId());
taskDefinitionToUpdate.setOperateTime(now);
taskDefinitionToUpdate.setCreateTime(now);
taskDefinitionToUpdate.setId(null);
int insert = taskDefinitionLogMapper.insert(taskDefinitionToUpdate);
if ((update & insert) != 1) {
logger.error("Update task definition or definitionLog error, projectCode:{}, taskDefinitionCode:{}.", projectCode, taskCode);