From 03f2892beed7ea311d51a05e258df9d81f176b0a Mon Sep 17 00:00:00 2001 From: Daniel Lackenby <11579453+KiraNamida@users.noreply.github.com> Date: Fri, 12 Jun 2026 17:31:39 +0100 Subject: [PATCH] Remove log that isn't providing value --- .../ImportCustomsOfficesListJob.scala | 22 ++++++------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/app/uk/gov/hmrc/crdlcache/schedulers/ImportCustomsOfficesListJob.scala b/app/uk/gov/hmrc/crdlcache/schedulers/ImportCustomsOfficesListJob.scala index e5f7c6e..d4a4d79 100644 --- a/app/uk/gov/hmrc/crdlcache/schedulers/ImportCustomsOfficesListJob.scala +++ b/app/uk/gov/hmrc/crdlcache/schedulers/ImportCustomsOfficesListJob.scala @@ -36,7 +36,7 @@ import uk.gov.hmrc.mongo.transaction.{TransactionConfiguration, Transactions} import java.time.{Clock, LocalDate, ZoneOffset} import javax.inject.Inject -import scala.concurrent.{ExecutionContext, Future} +import scala.concurrent.{Await, ExecutionContext, Future} import scala.concurrent.duration.* import java.time.Instant @@ -156,18 +156,10 @@ class ImportCustomsOfficesListJob @Inject() ( def execute( context: JobExecutionContext ): Unit = - val importFuture = withLock(importCustomsOfficeLists()).map { - _.getOrElse { logger.info("Import Customs offices job lock could not be obtained") } - } - for { - _ <- importFuture - postIngestOfficeCount <- customsOfficeListsRepository.customsOfficesCount( - Instant.now(), - domain = Some("NCTS"), - phase = Some("P6") - ) - _ = logger.warn( - s"Number of NCTS P6 Customs Offices post-ingest: ${postIngestOfficeCount}" - ) - } yield () + Await.result( + withLock(importCustomsOfficeLists()).map { + _.getOrElse { logger.info("Import Customs offices job lock could not be obtained") } + }, + Duration.Inf + ) }