Skip to content

Commit b3860db

Browse files
committed
Remove usage of java.time.Duration from OkHttpEngineConfig.buildClientFromConfig
1 parent 159e784 commit b3860db

File tree

1 file changed

+3
-4
lines changed
  • runtime/protocol/http-client-engines/http-client-engine-okhttp/jvm/src/aws/smithy/kotlin/runtime/http/engine/okhttp

1 file changed

+3
-4
lines changed

runtime/protocol/http-client-engines/http-client-engine-okhttp/jvm/src/aws/smithy/kotlin/runtime/http/engine/okhttp/OkHttpEngine.kt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import okhttp3.*
2020
import okhttp3.ConnectionPool
2121
import okhttp3.coroutines.executeAsync
2222
import java.util.concurrent.TimeUnit
23-
import kotlin.time.toJavaDuration
2423
import aws.smithy.kotlin.runtime.net.TlsVersion as SdkTlsVersion
2524
import okhttp3.TlsVersion as OkHttpTlsVersion
2625

@@ -95,9 +94,9 @@ private fun OkHttpEngineConfig.buildClientFromConfig(
9594
// appropriately internally). We don't want inner retry logic that inflates the number of retries.
9695
retryOnConnectionFailure(false)
9796

98-
connectTimeout(config.connectTimeout.toJavaDuration())
99-
readTimeout(config.socketReadTimeout.toJavaDuration())
100-
writeTimeout(config.socketWriteTimeout.toJavaDuration())
97+
connectTimeout(config.connectTimeout.inWholeNanoseconds, TimeUnit.NANOSECONDS)
98+
readTimeout(config.socketReadTimeout.inWholeNanoseconds, TimeUnit.NANOSECONDS)
99+
writeTimeout(config.socketWriteTimeout.inWholeNanoseconds, TimeUnit.NANOSECONDS)
101100

102101
// use our own pool configured with the timeout settings taken from config
103102
val pool = poolOverride ?: ConnectionPool(

0 commit comments

Comments
 (0)