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

logging for long polling

parent 3e7e331a
No related branches found
No related tags found
No related merge requests found
...@@ -694,6 +694,7 @@ private void longPollForNotFound(IngestJobState ingestJobState) throws Interrupt ...@@ -694,6 +694,7 @@ private void longPollForNotFound(IngestJobState ingestJobState) throws Interrupt
Bundle.MalwareScanIngestModule_longPollForNotFound_fileLookupPolling_title(), Bundle.MalwareScanIngestModule_longPollForNotFound_fileLookupPolling_title(),
Bundle.MalwareScanIngestModule_longPollForNotFound_fileLookupPolling_desc() Bundle.MalwareScanIngestModule_longPollForNotFound_fileLookupPolling_desc()
); );
logger.log(Level.INFO, "Begin polling for malware status of file uploads.");
Map<String, List<Long>> remaining = new HashMap<>(ingestJobState.getUnidentifiedHashes()); Map<String, List<Long>> remaining = new HashMap<>(ingestJobState.getUnidentifiedHashes());
...@@ -729,6 +730,9 @@ private void longPollForNotFound(IngestJobState ingestJobState) throws Interrupt ...@@ -729,6 +730,9 @@ private void longPollForNotFound(IngestJobState ingestJobState) throws Interrupt
// exponential backoff before trying again // exponential backoff before trying again
long waitMultiplier = ((long) Math.pow(2, retry)); long waitMultiplier = ((long) Math.pow(2, retry));
logger.log(Level.INFO, MessageFormat.format("Waiting {0} milliseconds before polling again for malware status of file uploads.", (waitMultiplier * FILE_UPLOAD_RETRY_SLEEP_MILLIS)));
for (int i = 0; i < waitMultiplier; i++) { for (int i = 0; i < waitMultiplier; i++) {
if (!ingestJobState.isDoFileLookups() || ingestJobState.getIngestJobContext().fileIngestIsCancelled()) { if (!ingestJobState.isDoFileLookups() || ingestJobState.getIngestJobContext().fileIngestIsCancelled()) {
return; return;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment