diff options
author | orionlee <orionlee@yahoo.com> | 2019-09-01 09:46:25 -0700 |
---|---|---|
committer | orionlee <orionlee@yahoo.com> | 2019-09-24 10:12:14 -0700 |
commit | 366146d22e1d29ea51e6a275d9c7cf8bd351a429 (patch) | |
tree | 80d202eec26bc13988fc09a468b33e0e2c388194 /core/src/main/java | |
parent | 907867652f94cdaad11d02a54cd39da8996ba213 (diff) | |
download | AntennaPod-366146d22e1d29ea51e6a275d9c7cf8bd351a429.zip |
prevent deadlock in case auto feed update is blocked per review.
Diffstat (limited to 'core/src/main/java')
-rw-r--r-- | core/src/main/java/de/danoeh/antennapod/core/service/FeedUpdateWorker.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/FeedUpdateWorker.java b/core/src/main/java/de/danoeh/antennapod/core/service/FeedUpdateWorker.java index f551ffa39..da3bfe734 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/FeedUpdateWorker.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/FeedUpdateWorker.java @@ -34,13 +34,13 @@ public class FeedUpdateWorker extends Worker { Log.d(TAG, "doWork() : isImmediate = " + isImmediate); ClientConfig.initialize(getApplicationContext()); - AtomicBoolean finished = new AtomicBoolean(false); if (NetworkUtils.networkAvailable() && NetworkUtils.isFeedRefreshAllowed()) { + AtomicBoolean finished = new AtomicBoolean(false); DBTasks.refreshAllFeeds(getApplicationContext(), null, () -> finished.set(true)); + Awaitility.await().until(finished::get); } else { Log.d(TAG, "Blocking automatic update: no wifi available / no mobile updates allowed"); } - Awaitility.await().until(finished::get); if (!isImmediate && UserPreferences.isAutoUpdateTimeOfDay()) { // WorkManager does not allow to set specific time for repeated tasks. |