From e2da41a9534143f3bd1ae3be7f27d34e820fd93b Mon Sep 17 00:00:00 2001 From: Said SEDOUD Date: Mon, 15 Jul 2024 17:24:21 +0200 Subject: [PATCH] fix status --- app/service/AntivirusService.scala | 5 ++++- conf/common/thread-pool.conf | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/service/AntivirusService.scala b/app/service/AntivirusService.scala index 26d6579..ccf2a03 100644 --- a/app/service/AntivirusService.scala +++ b/app/service/AntivirusService.scala @@ -79,6 +79,9 @@ class AntivirusService( for { fileDataOpt <- fileDataRepository.getByExternalId(List(externalFileId)).map(_.headOption) fileData <- fileDataOpt.liftTo[Future](UnknownExternalId(externalFileId)) - } yield fileData + status = fileData.scanResult.filter(i => + i == AntivirusScanExitCode.VirusFound.value || i == AntivirusScanExitCode.NoVirusFound.value + ) + } yield fileData.copy(scanResult = status) } diff --git a/conf/common/thread-pool.conf b/conf/common/thread-pool.conf index 66c0ac3..fcb2ffb 100644 --- a/conf/common/thread-pool.conf +++ b/conf/common/thread-pool.conf @@ -2,7 +2,7 @@ my-blocking-dispatcher { type = Dispatcher executor = "thread-pool-executor" thread-pool-executor { - fixed-pool-size = 8 + fixed-pool-size = 4 } throughput = 1 }