From 9e20507beaf7943c2447ad0d6fd4983a85c6760a Mon Sep 17 00:00:00 2001 From: Marjan Kalanaki Date: Wed, 2 Oct 2024 16:25:23 +0100 Subject: [PATCH] rename transcription output queue url config field --- backend/app/extraction/ExternalTranscriptionWorker.scala | 6 +++--- backend/app/services/Config.scala | 6 +++--- backend/app/utils/AwsDiscovery.scala | 2 +- backend/conf/application.conf | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/backend/app/extraction/ExternalTranscriptionWorker.scala b/backend/app/extraction/ExternalTranscriptionWorker.scala index bcc44616..67366524 100644 --- a/backend/app/extraction/ExternalTranscriptionWorker.scala +++ b/backend/app/extraction/ExternalTranscriptionWorker.scala @@ -20,10 +20,10 @@ class ExternalTranscriptionWorker(manifest: WorkerManifest, amazonSQSClient: Ama def pollForResults(): Int = { val messages = amazonSQSClient.receiveMessage( - new ReceiveMessageRequest(transcribeConfig.transcriptionServiceOutputQueueUrl).withMaxNumberOfMessages(10) + new ReceiveMessageRequest(transcribeConfig.transcriptionOutputQueueUrl).withMaxNumberOfMessages(10) ).getMessages - if (messages.size() > 0) logger.info(s"retrieved ${messages.size()} messages from queue ${transcribeConfig.transcriptionServiceOutputQueueUrl}") + if (messages.size() > 0) logger.info(s"retrieved ${messages.size()} messages from queue ${transcribeConfig.transcriptionOutputQueueUrl}") messages.asScala.toList.foldLeft(0) { (completed, message) => val result = for { @@ -34,7 +34,7 @@ class ExternalTranscriptionWorker(manifest: WorkerManifest, amazonSQSClient: Ama _ <- markAsComplete(transcriptionOutput.id, "ExternalTranscriptionExtractor") } yield { amazonSQSClient.deleteMessage( - new DeleteMessageRequest(transcribeConfig.transcriptionServiceOutputQueueUrl, message.getReceiptHandle) + new DeleteMessageRequest(transcribeConfig.transcriptionOutputQueueUrl, message.getReceiptHandle) ) logger.debug(s"deleted message for ${transcriptionOutput.id}") } diff --git a/backend/app/services/Config.scala b/backend/app/services/Config.scala index ec524745..392e757d 100644 --- a/backend/app/services/Config.scala +++ b/backend/app/services/Config.scala @@ -81,9 +81,9 @@ case class OcrConfig( ) case class TranscribeConfig( - whisperModelFilename: String, - transcriptionServiceQueueUrl: String, - transcriptionServiceOutputQueueUrl: String + whisperModelFilename: String, + transcriptionServiceQueueUrl: String, + transcriptionOutputQueueUrl: String ) case class WorkerConfig( diff --git a/backend/app/utils/AwsDiscovery.scala b/backend/app/utils/AwsDiscovery.scala index 2a22c88f..41d8bed4 100644 --- a/backend/app/utils/AwsDiscovery.scala +++ b/backend/app/utils/AwsDiscovery.scala @@ -75,7 +75,7 @@ object AwsDiscovery extends Logging { }.getOrElse(config.worker), transcribe = config.transcribe.copy( whisperModelFilename = readSSMParameter("transcribe/modelFilename", stack, stage, ssmClient), - transcriptionServiceOutputQueueUrl = readSSMParameter("transcribe/transcriptionServiceOutputQueueUrl", stack, stage, ssmClient), + transcriptionOutputQueueUrl = readSSMParameter("transcribe/transcriptionOutputQueueUrl", stack, stage, ssmClient), transcriptionServiceQueueUrl = readSSMParameter("transcribe/transcriptionServiceQueueUrl", stack, stage, ssmClient) ), underlying = config.underlying diff --git a/backend/conf/application.conf b/backend/conf/application.conf index 696cfc9a..de52c838 100644 --- a/backend/conf/application.conf +++ b/backend/conf/application.conf @@ -208,7 +208,7 @@ ocr { transcribe { whisperModelFilename = "ggml-base.bin" transcriptionServiceQueueUrl = "http://sqs.eu-west-1.localhost.localstack.cloud:4566/000000000000/transcription-service-task-queue-DEV.fifo" - transcriptionServiceOutputQueueUrl = "http://sqs.eu-west-1.localhost.localstack.cloud:4566/000000000000/giant-output-queue-DEV" + transcriptionOutputQueueUrl = "http://sqs.eu-west-1.localhost.localstack.cloud:4566/000000000000/giant-output-queue-DEV" } sqs {