fixes for cancellation

This commit is contained in:
Greg DiCristofaro 2023-07-27 18:32:32 -04:00
parent 2dd82a21ea
commit e3353b2916

View File

@ -639,10 +639,8 @@ public class MalwareScanIngestModule implements FileIngestModule {
}
/**
*
* @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 @@ public class MalwareScanIngestModule implements FileIngestModule {
}
// 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(