|
|
|
@ -23,7 +23,7 @@ import kotlin.math.min |
|
|
|
|
|
|
|
|
|
class MainViewModel(application: Application) : BaseViewModel(application) { |
|
|
|
|
private var threadCount = AppConfig.threadCount |
|
|
|
|
private var upTocPool = Executors.newFixedThreadPool(threadCount).asCoroutineDispatcher() |
|
|
|
|
private var upTocPool = Executors.newFixedThreadPool(min(threadCount,8)).asCoroutineDispatcher() |
|
|
|
|
val updateList = CopyOnWriteArraySet<String>() |
|
|
|
|
private val bookMap = ConcurrentHashMap<String, Book>() |
|
|
|
|
|
|
|
|
@ -38,7 +38,7 @@ class MainViewModel(application: Application) : BaseViewModel(application) { |
|
|
|
|
fun upPool() { |
|
|
|
|
threadCount = AppConfig.threadCount |
|
|
|
|
upTocPool.close() |
|
|
|
|
upTocPool = Executors.newFixedThreadPool(threadCount).asCoroutineDispatcher() |
|
|
|
|
upTocPool = Executors.newFixedThreadPool(min(threadCount,8)).asCoroutineDispatcher() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
fun upAllBookToc() { |
|
|
|
|