From 8ebeb4e3e950ec9ca0052e3db2b0b942872448f8 Mon Sep 17 00:00:00 2001 From: MohitMaliFtechiz Date: Tue, 17 Sep 2024 15:04:16 +0530 Subject: [PATCH] Improved the fetching and downloading the online library on low bandwidth. * Since the online library file is 19MB large and on slow bandwidth devices it takes more time to fetch that file. Our current read timeout is 60 seconds which is not enough for reading this file on slow bandwidth devices. So we have increased it to 180 seconds. --- .../org/kiwix/kiwixmobile/core/di/modules/NetworkModule.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/org/kiwix/kiwixmobile/core/di/modules/NetworkModule.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/di/modules/NetworkModule.kt index aafb0e93c..e849b0885 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/core/di/modules/NetworkModule.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/di/modules/NetworkModule.kt @@ -31,7 +31,11 @@ import java.util.concurrent.TimeUnit.SECONDS import javax.inject.Singleton const val CONNECTION_TIMEOUT = 10L -const val READ_TIMEOUT = 60L + +// increase the read timeout since the content is 19MB large so it takes +// more time to read on slow internet connection, and due to less read timeout +// the request is canceled. +const val READ_TIMEOUT = 180L const val CALL_TIMEOUT = 60L const val USER_AGENT = "kiwix-android-version:${BuildConfig.VERSION_CODE}" const val KIWIX_DOWNLOAD_URL = "https://mirror.download.kiwix.org/"