|
|
|
@ -21,7 +21,8 @@ import kotlinx.coroutines.delay |
|
|
|
|
import java.util.concurrent.Executors |
|
|
|
|
|
|
|
|
|
class MainViewModel(application: Application) : BaseViewModel(application) { |
|
|
|
|
var upTocPool = Executors.newFixedThreadPool(AppConfig.threadCount).asCoroutineDispatcher() |
|
|
|
|
private var upTocPool = |
|
|
|
|
Executors.newFixedThreadPool(AppConfig.threadCount).asCoroutineDispatcher() |
|
|
|
|
val updateList = hashSetOf<String>() |
|
|
|
|
|
|
|
|
|
override fun onCleared() { |
|
|
|
@ -29,6 +30,11 @@ class MainViewModel(application: Application) : BaseViewModel(application) { |
|
|
|
|
upTocPool.close() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
fun upPool() { |
|
|
|
|
upTocPool.close() |
|
|
|
|
upTocPool = Executors.newFixedThreadPool(AppConfig.threadCount).asCoroutineDispatcher() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
fun upChapterList() { |
|
|
|
|
execute { |
|
|
|
|
upChapterList(App.db.bookDao().hasUpdateBooks) |
|
|
|
|