校验书源加入超时设定,防止卡住

pull/306/head
gedoor 4 years ago
parent 22abac41d4
commit a5e2b51507
  1. 2
      app/src/main/java/io/legado/app/service/help/CheckSource.kt

@ -50,7 +50,7 @@ class CheckSource(val source: BookSource) {
): Coroutine<*> { ): Coroutine<*> {
val webBook = WebBook(source) val webBook = WebBook(source)
return webBook.searchBook(keyword, scope = scope, context = context) return webBook.searchBook(keyword, scope = scope, context = context)
.timeout(3000L) .timeout(6000L)
.onError(Dispatchers.IO) { .onError(Dispatchers.IO) {
source.addGroup("失效") source.addGroup("失效")
App.db.bookSourceDao().update(source) App.db.bookSourceDao().update(source)

Loading…
Cancel
Save