Merge pull request #7835 from gdicristofaro/AUT-2458-messaging

2458 long polling messaging
This commit is contained in:
Mark McKinnon 2023-08-22 14:41:18 -04:00 committed by GitHub
commit 11441c9382
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -700,6 +700,7 @@ class MalwareScanIngestModule implements FileIngestModule {
Bundle.MalwareScanIngestModule_longPollForNotFound_fileLookupPolling_title(),
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());
@ -735,6 +736,9 @@ class MalwareScanIngestModule implements FileIngestModule {
// exponential backoff before trying again
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++) {
if (!ingestJobState.isDoFileLookups() || ingestJobState.getIngestJobContext().fileIngestIsCancelled()) {
return;