Skip to content

Commit

Permalink
Merge pull request #130 from ghkdwlgns612/fix-listener
Browse files Browse the repository at this point in the history
Fix Issue: If status-listener throw exception, task not executed
  • Loading branch information
v1r3n authored Aug 17, 2024
2 parents 8914ae2 + b4a595f commit 5425b3f
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,18 @@ public List<Task> poll(
.map(executionDAOFacade::getTaskModel)
.filter(Objects::nonNull)
.filter(task -> TaskModel.Status.IN_PROGRESS.equals(task.getStatus()))
.forEach(taskStatusListener::onTaskInProgress);
.forEach(
task -> {
try {
taskStatusListener.onTaskInProgress(task);
} catch (Exception e) {
String errorMsg =
String.format(
"Error while notifying TaskStatusListener: %s for workflow: %s",
task.getTaskId(), task.getWorkflowInstanceId());
LOGGER.error(errorMsg, e);
}
});
executionDAOFacade.updateTaskLastPoll(taskType, domain, workerId);
Monitors.recordTaskPoll(queueName);
tasks.forEach(this::ackTaskReceived);
Expand Down

0 comments on commit 5425b3f

Please sign in to comment.