diff --git a/Core/src/com/basistech/df/cybertriage/autopsy/malwarescan/MalwareScanIngestModule.java b/Core/src/com/basistech/df/cybertriage/autopsy/malwarescan/MalwareScanIngestModule.java index 5cbbbed372a69a11d109b90d53e15c3b295ebeab..f528feb6533ffc708d99926a923e531f95c857a0 100644 --- a/Core/src/com/basistech/df/cybertriage/autopsy/malwarescan/MalwareScanIngestModule.java +++ b/Core/src/com/basistech/df/cybertriage/autopsy/malwarescan/MalwareScanIngestModule.java @@ -639,10 +639,8 @@ private boolean uploadFile(IngestJobState ingestJobState, String md5, long objId } /** - * - * @param ingestJobState - * @param md5objIdMapping - * @return + * Does long polling for any pending results. + * @param ingestJobState The state of the ingest job. * @throws InterruptedException * @throws CTCloudException * @throws org.sleuthkit.datamodel.Blackboard.BlackboardException @@ -696,7 +694,13 @@ private void longPollForNotFound(IngestJobState ingestJobState) throws Interrupt } // 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(