feat: 优化代码

pull/133/head
kunfei 5 years ago
parent 0983e43eaf
commit fa4ba277e2
  1. 4
      app/src/main/java/io/legado/app/service/CheckSourceService.kt

@ -64,7 +64,9 @@ class CheckSourceService : BaseService() {
private fun check() { private fun check() {
synchronized(this) {
processIndex++ processIndex++
}
if (processIndex < allIds.size) { if (processIndex < allIds.size) {
val sourceUrl = allIds[processIndex] val sourceUrl = allIds[processIndex]
@ -81,6 +83,7 @@ class CheckSourceService : BaseService() {
checkedIds.size, checkedIds.size,
getString(R.string.progress_show, checkedIds.size, allIds.size) getString(R.string.progress_show, checkedIds.size, allIds.size)
) )
synchronized(this) {
if (processIndex >= allIds.size + threadCount - 1) { if (processIndex >= allIds.size + threadCount - 1) {
stopSelf() stopSelf()
} }
@ -88,6 +91,7 @@ class CheckSourceService : BaseService() {
} }
} }
} }
}
/** /**
* 更新通知 * 更新通知

Loading…
Cancel
Save