Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.

Commit

Permalink
fix(network): increase timeout time
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreaBrighi committed May 22, 2023
1 parent 850dc15 commit aa5b558
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package com.intelligentbackpack.networkutility
import io.github.andreabrighi.converter.RetrofitJsonConverterFactory
import okhttp3.OkHttpClient
import retrofit2.Retrofit
import java.util.concurrent.TimeUnit

/**
* RetrofitHelper is an helper to create a Retrofit instance.
Expand All @@ -15,6 +16,8 @@ object RetrofitHelper {
*/
fun getInstance(baseUrl: String): Retrofit {
val httpClient = OkHttpClient.Builder()
.readTimeout(60, TimeUnit.SECONDS)
.connectTimeout(60, TimeUnit.SECONDS)
return Retrofit
.Builder()
.baseUrl(baseUrl)
Expand Down

0 comments on commit aa5b558

Please sign in to comment.