From 6b9175d24cefbe10fc60f5312db9d623c9365fac Mon Sep 17 00:00:00 2001 From: holmbergius Date: Sat, 10 Aug 2024 16:03:43 -0700 Subject: [PATCH] Prevents empty target annotation lists from being requeued --- src/main/java/org/ecocean/servlet/IAGateway.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/ecocean/servlet/IAGateway.java b/src/main/java/org/ecocean/servlet/IAGateway.java index 68c968da51..ba53c1b2d8 100644 --- a/src/main/java/org/ecocean/servlet/IAGateway.java +++ b/src/main/java/org/ecocean/servlet/IAGateway.java @@ -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);