Skip to content

Commit

Permalink
Ensure proper childTask storage
Browse files Browse the repository at this point in the history
  • Loading branch information
holmbergius committed Oct 29, 2024
1 parent 483d0bd commit 5d38850
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions src/main/java/org/ecocean/identity/IBEISIA.java
Original file line number Diff line number Diff line change
Expand Up @@ -2090,14 +2090,11 @@ public static JSONObject processCallback(String taskID, JSONObject resp, String
myShepherd.storeNewTask(subParentTask);
myShepherd.updateDBTransaction();

Task task = IA.intakeAnnotations(myShepherd2, annots, subParentTask, false);
// Here is a place we check downstream. IA.intakeAnnotations() will check the anns vs the identification classes in IA.properties,
// and return null if nobody was valid.
if (task != null) {
rtn.put("identificationTaskId", task.getId());
if (subParentTask != null) subParentTask.addChild(task);
myShepherd2.storeNewTask(task);
}
Task childTask = IA.intakeAnnotations(myShepherd2, annots, subParentTask, false);
myShepherd.storeNewTask(childTask);
myShepherd.updateDBTransaction();
subParentTask.addChild(childTask);
myShepherd.updateDBTransaction();

}

Expand All @@ -2108,7 +2105,7 @@ public static JSONObject processCallback(String taskID, JSONObject resp, String
"[INFO]: No annotations were suitable for identification. Check resulting identification class(es).");
myShepherd2.rollbackDBTransaction();
}
myShepherd2.closeDBTransaction();
myShepherd2.rollbackAndClose();
}
return rtn;
}
Expand Down

0 comments on commit 5d38850

Please sign in to comment.