Commit a8b9cec0 authored by Siiri Tann's avatar Siiri Tann
Browse files

TEIS-2787: updated virus-scan timeout and PollVirusScanResultTask and...

TEIS-2787: updated virus-scan timeout and PollVirusScanResultTask and UploadFileVirusScanTask error handling.
parent 5a4d36cb
......@@ -2,5 +2,5 @@ theGroup=ee.sm.ti.teis
theVersion=1.23.0-SNAPSHOT
commonsVersion=1.29.0-SNAPSHOT
commonApiGatewayVersion=1.29.0-SNAPSHOT
pluginVersion=1.4.3
pluginVersion=1.4.4
schedulerVersion=1.17.0
......@@ -4,6 +4,7 @@ import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import ee.sm.ti.teis.bpm.BpmProcess;
import ee.sm.ti.teis.domain.filesvirusscan.PollVirusScanResult;
import ee.sm.ti.teis.exceptions.TeisResourceNotFoundException;
import ee.sm.ti.teis.exceptions.TeisSystemAlertException;
import ee.sm.ti.teis.file.FileEntity;
import ee.sm.ti.teis.file.service.FileDataService;
......@@ -46,6 +47,9 @@ public class PollVirusScanResultTask implements JavaDelegate {
.build();
filesVirusScanServiceClient.pollVirusScanResult(domain, requestMetaDto);
} catch (TeisResourceNotFoundException e) {
log.error("File with id [{}] not found, virus scan process will be cancelled..", fileId);
handleTaskException(e, this.getClass().getSimpleName(), businessKey, requestMetaJson);
} catch (Exception e) {
String logMessage = logTaskException(e, this.getClass().getSimpleName(), businessKey, requestMetaJson);
throw new TeisSystemAlertException(logMessage, e);
......
......@@ -3,6 +3,7 @@ package ee.sm.ti.teis.file.virusscan.bpm;
import com.fasterxml.jackson.databind.ObjectMapper;
import ee.sm.ti.teis.bpm.BpmProcess;
import ee.sm.ti.teis.domain.filesvirusscan.StartVirusScan;
import ee.sm.ti.teis.exceptions.TeisResourceNotFoundException;
import ee.sm.ti.teis.exceptions.TeisStorageException;
import ee.sm.ti.teis.exceptions.TeisSystemAlertException;
import ee.sm.ti.teis.file.FileEntity;
......@@ -54,6 +55,9 @@ public class UploadFileVirusScanTask implements JavaDelegate {
} catch (TeisStorageException e) {
log.error("File not found from S3 bucket, virus scan process will be cancelled..");
handleTaskException(e, this.getClass().getSimpleName(), businessKey, requestMetaJson);
} catch (TeisResourceNotFoundException e) {
log.error("File with id [{}] not found, virus scan process will be cancelled..", fileId);
handleTaskException(e, this.getClass().getSimpleName(), businessKey, requestMetaJson);
} catch (Exception e) {
String logMessage = logTaskException(e, this.getClass().getSimpleName(), businessKey, requestMetaJson);
throw new TeisSystemAlertException(logMessage, e);
......
......@@ -67,7 +67,7 @@ teis:
clean-check-magic-string: api-test
camunda:
virus-scan:
retry-timeout: ${CAMUNDA_VIRUS_SCAN_RETRY_TIMEOUT:PT60M}
retry-timeout: ${CAMUNDA_VIRUS_SCAN_RETRY_TIMEOUT:P14D}
upload-retry-time-delay: ${CAMUNDA_VIRUS_SCAN_UPLOAD_RETRY_TIME_DELAY:PT300S}
poll-scan-status-delay: ${CAMUNDA_VIRUS_SCAN_POLL_SCAN_STATUS_DELAY:PT10S}
poll-system-error-delay: ${CAMUNDA_VIRUS_SCAN_POLL_SYSTEM_ERROR_DELAY:PT300S}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment