Skip to content

Commit

Permalink
Enable the indexing of tasks to be enabled / disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
bjpirt committed Mar 1, 2024
1 parent 39b4d31 commit f5d7d1a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ public class ConductorProperties {
@DurationUnit(ChronoUnit.SECONDS)
private Duration taskExecutionPostponeDuration = Duration.ofSeconds(60);

/** Used to enable/disable the indexing of tasks. */
private boolean taskIndexingEnabled = true;

/** Used to enable/disable the indexing of task execution logs. */
private boolean taskExecLogIndexingEnabled = true;

Expand Down Expand Up @@ -333,6 +336,14 @@ public void setTaskExecLogIndexingEnabled(boolean taskExecLogIndexingEnabled) {
this.taskExecLogIndexingEnabled = taskExecLogIndexingEnabled;
}

public boolean isTaskIndexingEnabled() {
return taskIndexingEnabled;
}

public void setTaskIndexingEnabled(boolean taskIndexingEnabled) {
this.taskIndexingEnabled = taskIndexingEnabled;
}

public boolean isAsyncIndexingEnabled() {
return asyncIndexingEnabled;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ public void updateTask(TaskModel taskModel) {
* of tasks on a system failure. So only index for each update if async indexing is not enabled.
* If it *is* enabled, tasks will be indexed only when a workflow is in terminal state.
*/
if (!properties.isAsyncIndexingEnabled()) {
if (!properties.isAsyncIndexingEnabled() && properties.isTaskIndexingEnabled()) {
indexDAO.indexTask(new TaskSummary(taskModel.toTask()));
}
} catch (TerminateWorkflowException e) {
Expand Down

0 comments on commit f5d7d1a

Please sign in to comment.