Skip to content

Commit 2717167

Browse files
authored
Run all config on one scheduler
Move scheduled jobs onto one scheduler as app is grinding to a halt when multiple are launched at once. This is a bandaid - we will improve the performance of this in the future
1 parent 3ed05da commit 2717167

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

app/src/main/java/com/duckduckgo/app/job/AppConfigurationDownloader.kt

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,9 @@ import com.duckduckgo.app.surrogates.api.ResourceSurrogateListDownloader
2323
import com.duckduckgo.app.trackerdetection.Client.ClientName.*
2424
import com.duckduckgo.app.trackerdetection.api.TrackerDataDownloader
2525
import io.reactivex.Completable
26-
import io.reactivex.schedulers.Schedulers
2726
import timber.log.Timber
2827

29-
interface ConfigurationDownloader{
28+
interface ConfigurationDownloader {
3029
fun downloadTask(): Completable
3130
}
3231

@@ -45,12 +44,12 @@ class AppConfigurationDownloader(
4544
val httpsUpgradeDownload = httpsUpgradeListDownloader.downloadList()
4645

4746
return Completable.mergeDelayError(listOf(
48-
easyListDownload.subscribeOn(Schedulers.io()),
49-
easyPrivacyDownload.subscribeOn(Schedulers.io()),
50-
trackersWhitelist.subscribeOn(Schedulers.io()),
51-
disconnectDownload.subscribeOn(Schedulers.io()),
52-
surrogatesDownload.subscribeOn(Schedulers.io()),
53-
httpsUpgradeDownload.subscribeOn(Schedulers.io())
47+
easyListDownload,
48+
easyPrivacyDownload,
49+
trackersWhitelist,
50+
disconnectDownload,
51+
surrogatesDownload,
52+
httpsUpgradeDownload
5453
)).doOnComplete {
5554
Timber.i("Download task completed successfully")
5655
val appConfiguration = AppConfigurationEntity(appConfigurationDownloaded = true)

0 commit comments

Comments
 (0)