Skip to content
Snippets Groups Projects
Commit e3353b29 authored by Greg DiCristofaro's avatar Greg DiCristofaro
Browse files

fixes for cancellation

parent 2dd82a21
Branches
Tags
No related merge requests found
...@@ -639,10 +639,8 @@ private boolean uploadFile(IngestJobState ingestJobState, String md5, long objId ...@@ -639,10 +639,8 @@ private boolean uploadFile(IngestJobState ingestJobState, String md5, long objId
} }
/** /**
* * Does long polling for any pending results.
* @param ingestJobState * @param ingestJobState The state of the ingest job.
* @param md5objIdMapping
* @return
* @throws InterruptedException * @throws InterruptedException
* @throws CTCloudException * @throws CTCloudException
* @throws org.sleuthkit.datamodel.Blackboard.BlackboardException * @throws org.sleuthkit.datamodel.Blackboard.BlackboardException
...@@ -696,7 +694,13 @@ private void longPollForNotFound(IngestJobState ingestJobState) throws Interrupt ...@@ -696,7 +694,13 @@ private void longPollForNotFound(IngestJobState ingestJobState) throws Interrupt
} }
// exponential backoff before trying again // exponential backoff before trying again
Thread.sleep(FILE_UPLOAD_RETRY_SLEEP_MILLIS * ((long) Math.pow(2, retry))); long waitMultiplier = ((long) Math.pow(2, retry));
for (int i = 0; i < waitMultiplier; i++) {
if (ingestJobState.getIngestJobContext().fileIngestIsCancelled()) {
return;
}
Thread.sleep(FILE_UPLOAD_RETRY_SLEEP_MILLIS);
}
} }
notifyWarning( notifyWarning(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment