This is an automated email from the ASF dual-hosted git repository.
zihaoxiang pushed a commit to branch 3.1.9-prepare
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git
The following commit(s) were added to refs/heads/3.1.9-prepare by this push:
new f4fae98d67 task definition log save only once. (#15016)
f4fae98d67 is described below
commit f4fae98d6723bdf77bd8254b571f037d851413ab
Author: HomminLee <[email protected]>
AuthorDate: Wed Nov 8 18:19:24 2023 +0800
task definition log save only once. (#15016)
---
.../dolphinscheduler/service/process/ProcessServiceImpl.java | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git
a/dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessServiceImpl.java
b/dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessServiceImpl.java
index 5734333626..05c789303b 100644
---
a/dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessServiceImpl.java
+++
b/dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessServiceImpl.java
@@ -2551,8 +2551,11 @@ public class ProcessServiceImpl implements
ProcessService {
// and update the origin one if exist
int updateResult = 0;
int insertResult = 0;
- if (CollectionUtils.isNotEmpty(newTaskDefinitionLogs)) {
- insertResult +=
taskDefinitionLogMapper.batchInsert(newTaskDefinitionLogs);
+ List<TaskDefinitionLog> newInsertTaskDefinitionLogs =
newTaskDefinitionLogs.stream()
+ .filter(taskDefinitionLog ->
!updateTaskDefinitionLogs.contains(taskDefinitionLog))
+ .collect(Collectors.toList());
+ if (CollectionUtils.isNotEmpty(newInsertTaskDefinitionLogs)) {
+ insertResult +=
taskDefinitionLogMapper.batchInsert(newInsertTaskDefinitionLogs);
}
if (CollectionUtils.isNotEmpty(updateTaskDefinitionLogs)) {
insertResult +=
taskDefinitionLogMapper.batchInsert(updateTaskDefinitionLogs);