This commit is contained in:
gedoor 2021-11-10 13:40:02 +08:00
parent 3244cc9ccd
commit c1a845185c

View File

@ -79,20 +79,22 @@ class SearchModel(private val scope: CoroutineScope, private val callBack: CallB
}
searchIndex++
val source = bookSourceList[searchIndex]
val task = WebBook.searchBook(
scope,
source,
searchKey,
searchPage,
context = searchPool!!
).timeout(30000L)
.onSuccess(searchPool) {
onSuccess(searchId, it)
}
.onFinally(searchPool) {
onFinally(searchId)
}
tasks.add(task)
searchPool?.let { searchPool ->
val task = WebBook.searchBook(
scope,
source,
searchKey,
searchPage,
context = searchPool
).timeout(30000L)
.onSuccess(searchPool) {
onSuccess(searchId, it)
}
.onFinally(searchPool) {
onFinally(searchId)
}
tasks.add(task)
}
}
@Synchronized