diff --git a/remoteav/VERSION b/remoteav/VERSION index 0cfbf08..00750ed 100644 --- a/remoteav/VERSION +++ b/remoteav/VERSION @@ -1 +1 @@ -2 +3 diff --git a/remoteav/service/al_run.py b/remoteav/service/al_run.py index a7232a5..adeb2c0 100644 --- a/remoteav/service/al_run.py +++ b/remoteav/service/al_run.py @@ -1,4 +1,5 @@ import random +import time import requests from assemblyline_v4_service.common.base import ServiceBase @@ -39,10 +40,12 @@ def execute(self, request: ServiceRequest) -> None: url = random.choice(self.url) self.log.debug("Selected service URL: %s", url) av_response = requests.post( - f"{url}/scan-file", files={"file": open(request.file_path, "rb")}, stream=True + f"{url}/scan-file", files={"file": open(request.file_path, "rb")} ) # kind of a hacky retry for uploading issues if av_response.status_code == 504: + self.log.warning("Remote AV server is busy or network has issues, retrying...") + time.sleep(random.uniform(0.1, 1)) continue break @@ -57,5 +60,4 @@ def execute(self, request: ServiceRequest) -> None: main_section.add_tag("av.virus_name", av_result["av_result"]) main_section.set_heuristic(1) - main_section = ResultTextSection("Results of scoring") result.add_section(main_section) diff --git a/remoteav/service_manifest.yml b/remoteav/service_manifest.yml index 27c37d4..258a9e5 100644 --- a/remoteav/service_manifest.yml +++ b/remoteav/service_manifest.yml @@ -42,7 +42,8 @@ heuristics: docker_config: image: ${REGISTRY}ghcr.io/kam193/assemblyline-service-remoteav:$SERVICE_TAG cpu_cores: 0.25 - ram_mb: 512 + # has to be able to read the file to scan + ram_mb: 768 ram_mb_min: 256 allow_internet_access: true