Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions app/src/main/java/net/vonforst/evmap/api/nobil/NobilApi.kt
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ import retrofit2.http.POST
import retrofit2.http.Query
import java.io.IOException
import java.time.Duration
import java.util.concurrent.TimeUnit

private const val maxResults = 2000

Expand Down Expand Up @@ -86,14 +87,17 @@ interface NobilApi {
baseurl: String,
context: Context?
): NobilApi {
val client = OkHttpClient.Builder().apply {
if (BuildConfig.DEBUG) {
addDebugInterceptors()
val client = OkHttpClient.Builder()
.readTimeout(60, TimeUnit.SECONDS)
.apply {
if (BuildConfig.DEBUG) {
addDebugInterceptors()
}
if (context != null) {
cache(Cache(context.cacheDir, cacheSize))
}
}
if (context != null) {
cache(Cache(context.cacheDir, cacheSize))
}
}.build()
.build()

val retrofit = Retrofit.Builder()
.baseUrl(baseurl)
Expand Down
Loading