From 859ff69055b0914963ed8af0f217b887bacb21f4 Mon Sep 17 00:00:00 2001 From: Adam Fowler Date: Sat, 7 Nov 2020 09:46:46 +0000 Subject: [PATCH] Add connection timeout for HTTP clients created by AWSClient --- Sources/SotoCore/AWSClient.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/SotoCore/AWSClient.swift b/Sources/SotoCore/AWSClient.swift index 64ff56030..7f108d162 100644 --- a/Sources/SotoCore/AWSClient.swift +++ b/Sources/SotoCore/AWSClient.swift @@ -101,9 +101,9 @@ public final class AWSClient { case .shared(let providedHTTPClient): self.httpClient = providedHTTPClient case .createNewWithEventLoopGroup(let elg): - self.httpClient = AsyncHTTPClient.HTTPClient(eventLoopGroupProvider: .shared(elg)) + self.httpClient = AsyncHTTPClient.HTTPClient(eventLoopGroupProvider: .shared(elg), configuration: .init(timeout: .init(connect: .seconds(10)))) case .createNew: - self.httpClient = AsyncHTTPClient.HTTPClient(eventLoopGroupProvider: .createNew) + self.httpClient = AsyncHTTPClient.HTTPClient(eventLoopGroupProvider: .createNew, configuration: .init(timeout: .init(connect: .seconds(10)))) } self.credentialProvider = credentialProviderFactory.createProvider(context: .init(