Skip to content

Commit

Permalink
Prevents empty target annotation lists from being requeued
Browse files Browse the repository at this point in the history
  • Loading branch information
holmbergius committed Sep 19, 2024
1 parent fbbdf49 commit 6b9175d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/java/org/ecocean/servlet/IAGateway.java
Original file line number Diff line number Diff line change
Expand Up @@ -464,11 +464,13 @@ private static JSONObject _sendIdentificationTask(Annotation ann, String context
IBEISIA.waitForIAPriming();
JSONObject sent = IBEISIA.beginIdentifyAnnotations(qanns, matchingSet, queryConfigDict,
userConfidence, myShepherd, task, baseUrl, fastlane);
if (!sent.optBoolean("success", false)) {
if (!sent.optBoolean("success", false) && sent.toString().indexOf("emptyTargetAnnotations")==-1) {

String errorMsg = sent.optString("error", "(unknown error)");
System.out.println("beginIdentifyAnnotations() was unsuccessful due to " +
errorMsg + "; hopefully we requeue");
throw new IOException("beginIdentifyAnnotations() failed due to " + errorMsg);

}
ann.setIdentificationStatus(IBEISIA.STATUS_PROCESSING);
taskRes.put("beginIdentify", sent);
Expand Down

0 comments on commit 6b9175d

Please sign in to comment.