diff --git a/postgres-persistence/src/main/java/com/netflix/conductor/postgres/dao/PostgresExecutionDAO.java b/postgres-persistence/src/main/java/com/netflix/conductor/postgres/dao/PostgresExecutionDAO.java index 5ac642e93..aa5233f6b 100644 --- a/postgres-persistence/src/main/java/com/netflix/conductor/postgres/dao/PostgresExecutionDAO.java +++ b/postgres-persistence/src/main/java/com/netflix/conductor/postgres/dao/PostgresExecutionDAO.java @@ -136,9 +136,10 @@ private static String taskKey(TaskModel task) { public List createTasks(List tasks) { List created = Lists.newArrayListWithCapacity(tasks.size()); - for (TaskModel task : tasks) { - withTransaction( - connection -> { + withTransaction( + connection -> { + for (TaskModel task : tasks) { + validate(task); task.setScheduledTime(System.currentTimeMillis()); @@ -155,7 +156,7 @@ public List createTasks(List tasks) { + task.getReferenceTaskName() + ", key=" + taskKey); - return; + continue; } insertOrUpdateTaskData(connection, task); @@ -164,8 +165,8 @@ public List createTasks(List tasks) { updateTask(connection, task); created.add(task); - }); - } + } + }); return created; }