From 14aaca302387e5af80eb090bf4259bc458b53859 Mon Sep 17 00:00:00 2001 From: Richard Meng Date: Wed, 20 Dec 2023 16:30:36 +0800 Subject: [PATCH] Fix redundant taskDef in DB --- .../java/com/netflix/conductor/common/metadata/tasks/Task.java | 2 ++ core/src/main/java/com/netflix/conductor/model/TaskModel.java | 1 + 2 files changed, 3 insertions(+) diff --git a/common/src/main/java/com/netflix/conductor/common/metadata/tasks/Task.java b/common/src/main/java/com/netflix/conductor/common/metadata/tasks/Task.java index f51016340..fa8ed1906 100644 --- a/common/src/main/java/com/netflix/conductor/common/metadata/tasks/Task.java +++ b/common/src/main/java/com/netflix/conductor/common/metadata/tasks/Task.java @@ -24,6 +24,7 @@ import com.netflix.conductor.annotations.protogen.ProtoMessage; import com.netflix.conductor.common.metadata.workflow.WorkflowTask; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.google.protobuf.Any; import io.swagger.v3.oas.annotations.Hidden; @@ -629,6 +630,7 @@ public void setOutputMessage(Any outputMessage) { /** * @return {@link Optional} containing the task definition if available */ + @JsonIgnore public Optional getTaskDefinition() { return Optional.ofNullable(this.getWorkflowTask()).map(WorkflowTask::getTaskDefinition); } diff --git a/core/src/main/java/com/netflix/conductor/model/TaskModel.java b/core/src/main/java/com/netflix/conductor/model/TaskModel.java index 617b013da..62891ada3 100644 --- a/core/src/main/java/com/netflix/conductor/model/TaskModel.java +++ b/core/src/main/java/com/netflix/conductor/model/TaskModel.java @@ -571,6 +571,7 @@ public void incrementPollCount() { /** * @return {@link Optional} containing the task definition if available */ + @JsonIgnore public Optional getTaskDefinition() { return Optional.ofNullable(this.getWorkflowTask()).map(WorkflowTask::getTaskDefinition); }