From d28d3d5586cab7d913dbc9d0f736ec39a1c19030 Mon Sep 17 00:00:00 2001 From: Agnes Garoux Date: Fri, 12 Apr 2024 15:32:30 +0100 Subject: [PATCH] use S3AsyncClient.crtCreate --- .../storage_service/bag_replicator/Main.scala | 23 ++++++++----------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/bag_replicator/src/main/scala/weco/storage_service/bag_replicator/Main.scala b/bag_replicator/src/main/scala/weco/storage_service/bag_replicator/Main.scala index 953665a51..ed5fd21e5 100644 --- a/bag_replicator/src/main/scala/weco/storage_service/bag_replicator/Main.scala +++ b/bag_replicator/src/main/scala/weco/storage_service/bag_replicator/Main.scala @@ -3,7 +3,8 @@ package weco.storage_service.bag_replicator import akka.actor.ActorSystem import com.azure.storage.blob.{BlobServiceClient, BlobServiceClientBuilder} import com.typesafe.config.Config -import software.amazon.awssdk.services.s3.S3Client + +import software.amazon.awssdk.services.s3.{S3AsyncClient, S3Client} import software.amazon.awssdk.services.s3.presigner.S3Presigner import software.amazon.awssdk.services.sqs.SqsAsyncClient import software.amazon.awssdk.transfer.s3.S3TransferManager @@ -24,16 +25,8 @@ import weco.storage_service.bag_replicator.replicator.azure.AzureReplicator import weco.storage_service.bag_replicator.replicator.models.ReplicationSummary import weco.storage_service.bag_replicator.replicator.s3.S3Replicator import weco.storage_service.bag_replicator.services.BagReplicatorWorker -import weco.storage_service.config.builders.{ - IngestUpdaterBuilder, - OperationNameBuilder, - OutgoingPublisherBuilder -} -import weco.storage_service.ingests.models.{ - AmazonS3StorageProvider, - AzureBlobStorageProvider, - StorageProvider -} +import weco.storage_service.config.builders.{IngestUpdaterBuilder, OperationNameBuilder, OutgoingPublisherBuilder} +import weco.storage_service.ingests.models.{AmazonS3StorageProvider, AzureBlobStorageProvider, StorageProvider} import weco.storage_service.storage.models.IngestStepResult import weco.typesafe.WellcomeTypesafeApp import weco.typesafe.config.builders.EnrichConfig._ @@ -53,8 +46,12 @@ object Main extends WellcomeTypesafeApp { implicit val s3Client: S3Client = S3Client.builder().build() + + implicit val s3AsyncClient: S3AsyncClient = + S3AsyncClient.crtCreate + implicit val s3TransferManager: S3TransferManager = - S3TransferManager.builder().build() + S3TransferManager.builder().s3Client(s3AsyncClient).build() implicit val s3Presigner: S3Presigner = S3Presigner.builder().build() @@ -63,7 +60,7 @@ object Main extends WellcomeTypesafeApp { CloudWatchBuilder.buildCloudWatchMetrics(config) implicit val sqsClient: SqsAsyncClient = - SqsAsyncClient.builder().build() + SqsAsyncClient.builder().build()use implicit val lockDao: DynamoLockDao = DynamoLockDaoBuilder.buildDynamoLockDao(config)