feat: 适配okhttp3
This commit is contained in:
parent
0391c73916
commit
787df0801b
|
|
@ -7,7 +7,7 @@ Room 数据持久化;Worker管理上传任务,初次上传+重试共5次,
|
|||
| release | https://track.23544.com | 否 |
|
||||
|
||||
### 使用
|
||||
#### 1.0.8
|
||||
#### 1.0.12
|
||||
```kotlin
|
||||
repositories {
|
||||
google()
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ plugins {
|
|||
id("maven-publish")
|
||||
}
|
||||
group = "com.yuanxuan"
|
||||
version = "1.0.10"
|
||||
version = "1.0.12"
|
||||
|
||||
|
||||
val baseReleaseUrl: Provider<String> = providers.gradleProperty("baseReleaseUrl")
|
||||
|
|
@ -51,8 +51,12 @@ android {
|
|||
}
|
||||
|
||||
publishing {
|
||||
singleVariant("debug")
|
||||
singleVariant("release")
|
||||
singleVariant("debug"){
|
||||
withSourcesJar()
|
||||
}
|
||||
singleVariant("release"){
|
||||
withSourcesJar()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@ import okhttp3.OkHttpClient
|
|||
import okhttp3.logging.HttpLoggingInterceptor
|
||||
import retrofit2.Retrofit
|
||||
import retrofit2.converter.moshi.MoshiConverterFactory
|
||||
import java.util.concurrent.TimeUnit
|
||||
import kotlin.jvm.java
|
||||
import kotlin.time.Duration.Companion.seconds
|
||||
|
||||
internal object RetrofitClient {
|
||||
private val okHttpClient: OkHttpClient by lazy {
|
||||
|
|
@ -19,9 +19,9 @@ internal object RetrofitClient {
|
|||
}
|
||||
}
|
||||
OkHttpClient.Builder()
|
||||
.connectTimeout(15.seconds)
|
||||
.readTimeout(30.seconds)
|
||||
.writeTimeout(30.seconds)
|
||||
.connectTimeout(15L, TimeUnit.SECONDS)
|
||||
.readTimeout(30L, TimeUnit.SECONDS)
|
||||
.writeTimeout(30L, TimeUnit.SECONDS)
|
||||
.addInterceptor(httpLoggingInterceptor)
|
||||
.build()
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue