Parcourir la source

@task: update connect time out

bai il y a 3 ans
Parent
commit
1034f67664

+ 3 - 3
demo/src/main/java/com/framework/di/Di.kt

@@ -36,9 +36,9 @@ val httpModule = DI.Module("netModule") {
     bind {
         singleton {
             OkHttpClient.Builder()
-                .connectTimeout(10, TimeUnit.SECONDS)
-                .readTimeout(300, TimeUnit.SECONDS)
-                .writeTimeout(300, TimeUnit.SECONDS)
+                .connectTimeout(100, TimeUnit.SECONDS)
+                .readTimeout(3000, TimeUnit.SECONDS)
+                .writeTimeout(3000, TimeUnit.SECONDS)
                 .addInterceptor(instance<HttpLoggingInterceptor>())
                 .addInterceptor(instance<GzipRequestInterceptor>())
                 .build()

+ 1 - 1
demo/src/main/java/com/framework/mvvm/model/vo/Building.kt

@@ -16,7 +16,7 @@ data class Building(
     val problemEquip: List<ProblemEquipEntity>?,
     val pipes: List<PipeEntity>?,
     val areas: List<ServeAreaEntity>?,
-    val bdtpDownloadTs: Long = 0L,   // bdtp数据库下载同步时间戳
+    val bdtpDownloadTs: Long = 0L,    // bdtp数据库下载同步时间戳
     val admDownloadTs: Long = 0L,     // adm数据库下载同步时间戳
     val uploadJobId: String = ""
 )

+ 2 - 2
demo/src/main/java/com/framework/mvvm/mv/AdmViewModel.kt

@@ -89,9 +89,9 @@ class AdmViewModel(private val repository: AdmRepository) : ViewModel() {
     ) {
         viewModelScope.launch(Dispatchers.IO) {
             val buildings = repository.getBuildings()
-            println("downloadBuilding will download : ${buildings.size} $buildings")
+            println("downloadBuilding will download : ${buildings.size}")
             if (buildings.isEmpty()) {
-                Log.d("downloadBuilding","buildings is empty")
+                Log.d("downloadBuilding", "buildings is empty")
                 return@launch
             }
             for (building in buildings) {