Skip to content

Commit

Permalink
increase networking timeouts
Browse files Browse the repository at this point in the history
  • Loading branch information
hrj committed Feb 16, 2017
1 parent aef53af commit 3712d7a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/co/uproot/unplug/api.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import okhttp3.RequestBody
import java.io.IOException
import java.net.URLEncoder
import java.util.ArrayList
import java.util.concurrent.TimeUnit
import java.util.concurrent.atomic.AtomicLong

data class AccessToken(val token: String)
Expand Down Expand Up @@ -79,7 +80,13 @@ class API(val baseURL: String) {
val apiURL = baseURL + "_matrix/client/r0/"
val mediaURL = baseURL + "_matrix/media/r0/"

private final val client = OkHttpClient.Builder().followRedirects(false).followSslRedirects(false).build()
private final val client = OkHttpClient.Builder()
.followRedirects(false)
.followSslRedirects(false)
.connectTimeout(40, TimeUnit.SECONDS)
.readTimeout(40, TimeUnit.SECONDS)
.writeTimeout(40, TimeUnit.SECONDS)
.build()

private final val net = Net(client)

Expand Down

0 comments on commit 3712d7a

Please sign in to comment.