logging for long polling

This commit is contained in:
Greg DiCristofaro 2023-08-18 13:27:07 -04:00
parent 3e7e331aa1
commit eb6f7a4f78

View File

@ -694,6 +694,7 @@ class MalwareScanIngestModule implements FileIngestModule {
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 @@ class MalwareScanIngestModule implements FileIngestModule {
// 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;