Merge pull request #2117 from 821938089/fix-check-source-slow

修复书源校验时线程数会变少的bug
pull/2119/head
kunfei 2 years ago committed by GitHub
commit 8779e86f9e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      app/src/main/java/io/legado/app/service/CheckSourceService.kt

@ -190,6 +190,15 @@ class CheckSourceService : BaseService() {
}.onSuccess(searchCoroutine) {
source.removeGroup("校验超时")
Debug.updateFinalMessage(source.bookSourceUrl, "校验成功")
}.onCancel(IO) {
source.addGroup("校验超时")
source.bookSourceComment =
"Error: 校验超时" + if (source.bookSourceComment.isNullOrBlank())
"" else "\n\n${source.bookSourceComment}"
Debug.updateFinalMessage(source.bookSourceUrl, "校验失败: 校验超时")
source.respondTime = Debug.getRespondTime(source.bookSourceUrl)
appDb.bookSourceDao.update(source)
onNext(source.bookSourceUrl, source.bookSourceName)
}.onFinally(IO) {
source.respondTime = Debug.getRespondTime(source.bookSourceUrl)
appDb.bookSourceDao.update(source)

Loading…
Cancel
Save