Skip to content

Commit

Permalink
⚡️ Increased OkHttp timeout; it will be handled by Klopik class
Browse files Browse the repository at this point in the history
  • Loading branch information
vegidio committed May 19, 2024
1 parent 55f7e3f commit 64aa711
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ With the repository added, you just need to include the dependency in the file `

```kotlin
dependencies {
implementation("io.vinicius.klopik:klopik:24.4.7")
implementation("io.vinicius.klopik:klopik:24.5.0")
}
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,14 @@ import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.RequestBody.Companion.toRequestBody
import okio.Buffer
import java.util.concurrent.TimeUnit

private val client = OkHttpClient()
private val client = OkHttpClient().newBuilder()
.connectTimeout(30, TimeUnit.DAYS)
.readTimeout(30, TimeUnit.DAYS)
.writeTimeout(30, TimeUnit.DAYS)
.callTimeout(30, TimeUnit.DAYS)
.build()

internal actual fun platformRequest(
method: Method,
Expand Down
9 changes: 8 additions & 1 deletion library/src/jvmMain/kotlin/io/vinicius/klopik/Platform.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,15 @@ import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.RequestBody.Companion.toRequestBody
import okio.Buffer
import java.util.concurrent.TimeUnit

private val client = OkHttpClient()
// Long timeout because the actual timeout is handled by Klopik
private val client = OkHttpClient().newBuilder()
.connectTimeout(30, TimeUnit.DAYS)
.readTimeout(30, TimeUnit.DAYS)
.writeTimeout(30, TimeUnit.DAYS)
.callTimeout(30, TimeUnit.DAYS)
.build()

internal actual fun platformRequest(
method: Method,
Expand Down

0 comments on commit 64aa711

Please sign in to comment.