Skip to content

Commit 6e6dd1c

Browse files
committed
chore: http client config changes
1 parent 968fdb9 commit 6e6dd1c

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

shared/src/commonMain/kotlin/dev/suresh/http/Config.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ data class Timeout(val connection: Duration, val read: Duration, val write: Dura
1212

1313
data class Retry(val attempts: Int, val maxDelay: Duration) {
1414
companion object {
15-
val DEFAULT = Retry(attempts = 2, maxDelay = 2.seconds)
15+
val DEFAULT = Retry(attempts = 2, maxDelay = 5.seconds)
1616
}
1717
}
1818

shared/src/commonMain/kotlin/dev/suresh/http/HttpClient.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ expect fun httpClient(
6161
retryOnException(retryOnTimeout = true)
6262
retryOnServerErrors()
6363
exponentialDelay(maxDelayMs = retry.maxDelay.inWholeMilliseconds)
64+
// modifyRequest { it.headers.append("X_RETRY_COUNT", retryCount.toString()) }
6465
}
6566

6667
install(HttpTimeout) {
@@ -85,6 +86,7 @@ expect fun httpClient(
8586
httpLogger.info { message }
8687
}
8788
}
89+
format = LoggingFormat.OkHttp
8890
sanitizeHeader { header -> header == HttpHeaders.Authorization }
8991

9092
// filter { it.url.host.contains("localhost").not() }

0 commit comments

Comments
 (0)