From 981af58fbc02e1af0a7aa1090e2eb95d00a75400 Mon Sep 17 00:00:00 2001 From: perol Date: Sun, 22 Aug 2021 22:15:04 +0800 Subject: [PATCH] fix queue task --- android/app/build.gradle | 4 ++-- lib/er/fetcher.dart | 10 ++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 47f48b0d3..5e9e93e43 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -84,8 +84,8 @@ android { applicationId packageName minSdkVersion 21 targetSdkVersion 30 - versionCode 10005086 - versionName "0.5.9 X" + versionCode 10006010 + versionName "0.6.1 X" } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 diff --git a/lib/er/fetcher.dart b/lib/er/fetcher.dart index fea638686..ee9ed33bc 100644 --- a/lib/er/fetcher.dart +++ b/lib/er/fetcher.dart @@ -154,8 +154,14 @@ class Fetcher { nextJob() { if (queue.isNotEmpty && urlPool.length < userSetting.maxRunningTask) { - var first = queue.first; - if (urlPool.contains(first)) return; + TaskBean? first = null; + for (var i in queue) { + if (!urlPool.contains(i.url)) { + first = i; + break; + } + } + if (first == null) return; IsoContactBean isoContactBean = IsoContactBean(state: IsoTaskState.APPEND, data: first); sendPortToChild?.send(isoContactBean);