From 0ee98d6c93a283363e840d4da93caf26cd8f0a01 Mon Sep 17 00:00:00 2001 From: kunfei Date: Mon, 2 Dec 2019 17:39:26 +0800 Subject: [PATCH] up --- app/src/main/java/io/legado/app/service/DownloadService.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/src/main/java/io/legado/app/service/DownloadService.kt b/app/src/main/java/io/legado/app/service/DownloadService.kt index 24ca25ce5..f2ab3fbb6 100644 --- a/app/src/main/java/io/legado/app/service/DownloadService.kt +++ b/app/src/main/java/io/legado/app/service/DownloadService.kt @@ -7,8 +7,11 @@ import io.legado.app.base.BaseService import io.legado.app.constant.Action import io.legado.app.constant.AppConst import io.legado.app.help.IntentHelp +import kotlinx.coroutines.asCoroutineDispatcher +import java.util.concurrent.Executors class DownloadService : BaseService() { + private var searchPool = Executors.newFixedThreadPool(16).asCoroutineDispatcher() override fun onCreate() { super.onCreate() @@ -27,6 +30,7 @@ class DownloadService : BaseService() { override fun onDestroy() { super.onDestroy() + searchPool.close() } private fun download() {