pull/1463/head
gedoor 3 years ago
parent 262db8515b
commit 099b9b21db
  1. 1
      app/src/main/java/io/legado/app/data/AppDatabase.kt
  2. 2
      app/src/main/java/io/legado/app/data/entities/HttpTTS.kt
  3. 5
      app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeUrl.kt

@ -86,6 +86,7 @@ abstract class AppDatabase : RoomDatabase() {
db.execSQL("update book_sources set loginUi = null where loginUi = 'null'")
db.execSQL("update rssSources set loginUi = null where loginUi = 'null'")
db.execSQL("update httpTTS set loginUi = null where loginUi = 'null'")
db.execSQL("update httpTTS set concurrentRate = '0' where loginUi is null")
}
}

@ -18,7 +18,7 @@ data class HttpTTS(
var name: String = "",
var url: String = "",
var contentType: String? = null,
override var concurrentRate: String? = null,
override var concurrentRate: String? = "0",
override var loginUrl: String? = null,
override var loginUi: String? = null,
override var header: String? = null,

@ -285,9 +285,10 @@ class AnalyzeUrl(
if (concurrentRate.isNullOrEmpty()) {
return
}
val fetchRecord = accessTime[source.getKey()]
var fetchRecord = accessTime[source.getKey()]
if (fetchRecord == null) {
accessTime[source.getKey()] = FetchRecord(System.currentTimeMillis(), 1)
fetchRecord = FetchRecord(System.currentTimeMillis(), 1)
accessTime[source.getKey()] = fetchRecord
return
}
val waitTime = synchronized(fetchRecord) {

Loading…
Cancel
Save