Skip to content

Commit

Permalink
Increase timeout (#1071)
Browse files Browse the repository at this point in the history
  • Loading branch information
MV-GH authored Jul 20, 2023
1 parent d6aa4df commit e73b10d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/src/main/java/com/jerboa/api/Http.kt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import retrofit2.http.*
import java.io.InputStream
import java.net.MalformedURLException
import java.net.URL
import java.util.concurrent.TimeUnit
import okhttp3.Response as HttpResponse

const val VERSION = "v3"
Expand Down Expand Up @@ -276,6 +277,9 @@ interface API {

private fun buildApi(baseUrl: String): API {
val client: OkHttpClient = OkHttpClient.Builder()
.connectTimeout(30, TimeUnit.SECONDS)
.writeTimeout(30, TimeUnit.SECONDS)
.readTimeout(30, TimeUnit.SECONDS)
.addInterceptor { chain ->
val requestBuilder = chain.request().newBuilder()
.header("User-Agent", "Jerboa")
Expand Down

0 comments on commit e73b10d

Please sign in to comment.