diff --git a/app/Components.scala b/app/Components.scala index fbeb3808a0b..2e081ee4b50 100644 --- a/app/Components.scala +++ b/app/Components.scala @@ -79,7 +79,7 @@ class AppComponents(context: Context, val config: ApplicationConfiguration) val collectionService = new CollectionService(frontsApi, containerService) val faciaPressQueue = new FaciaPressQueue(config) val faciaPressTopic = new FaciaPressTopic(config) - val faciaPress = new FaciaPress(faciaPressQueue, configAgent) + val faciaPress = new FaciaPress(faciaPressQueue, faciaPressTopic, configAgent) val updateActions = new UpdateActions(faciaApiIO, frontsApi, config, configAgent, structuredLogger) val updateManager = new UpdateManager(updateActions, configAgent, s3FrontsApi) val cloudwatch = new CloudWatch(config, awsEndpoints) diff --git a/app/services/FaciaPress.scala b/app/services/FaciaPress.scala index dd791370eea..0d936393dce 100644 --- a/app/services/FaciaPress.scala +++ b/app/services/FaciaPress.scala @@ -75,7 +75,7 @@ class FaciaPressTopic(val config: ApplicationConfiguration) { } -class FaciaPress(val faciaPressQueue: FaciaPressQueue, val configAgent: ConfigAgent) extends Logging { +class FaciaPress(val faciaPressQueue: FaciaPressQueue, val faciaPressTopic: FaciaPressTopic, val configAgent: ConfigAgent) extends Logging { def press(pressCommand: PressCommand): Future[List[SendMessageResult]] = { configAgent.refreshAndReturn() flatMap { _ => val paths: Set[String] = for { @@ -94,6 +94,14 @@ class FaciaPress(val faciaPressQueue: FaciaPressQueue, val configAgent: ConfigAg case Success(_) => EnqueuePressSuccess.increment() } + val fut2 = Future.traverse(paths)(path => faciaPressTopic.publish(PressJob(FrontPath(path), Live, forceConfigUpdate = pressCommand.forceConfigUpdate))) + fut2.onComplete { + case Failure(error) => + EnqueuePressFailure.increment() + logger.error("Error manually pressing live collection through update from tool", error) + case Success(_) => + EnqueuePressSuccess.increment() + } fut } else { Future.successful(Set.empty) @@ -110,6 +118,14 @@ class FaciaPress(val faciaPressQueue: FaciaPressQueue, val configAgent: ConfigAg case Success(_) => EnqueuePressSuccess.increment() } + val fut2 = Future.traverse(paths)(path => faciaPressTopic.publish(PressJob(FrontPath(path), Draft, forceConfigUpdate = pressCommand.forceConfigUpdate))) + fut2.onComplete { + case Failure(error) => + EnqueuePressFailure.increment() + logger.error("Error manually pressing draft collection through update from tool", error) + case Success(_) => + EnqueuePressSuccess.increment() + } fut } else Future.successful(Set.empty)