From adf1f87364c0837b1376e56dd3462c1ea5718aec Mon Sep 17 00:00:00 2001 From: KaiserBh Date: Wed, 22 Nov 2023 23:15:23 +1100 Subject: [PATCH] fix: Timeout issue for people running reverse proxy. It seem like the 10 second timeout for POST gives timeout for nginx users that uses reverse proxy and this should fix it. Signed-off-by: KaiserBh --- .../tachiyomi/data/sync/service/SyncYomiSyncService.kt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/sync/service/SyncYomiSyncService.kt b/app/src/main/java/eu/kanade/tachiyomi/data/sync/service/SyncYomiSyncService.kt index f623eb773..d7404bcce 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/sync/service/SyncYomiSyncService.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/sync/service/SyncYomiSyncService.kt @@ -14,6 +14,7 @@ import okhttp3.RequestBody.Companion.gzip import okhttp3.RequestBody.Companion.toRequestBody import tachiyomi.core.util.system.logcat import tachiyomi.domain.sync.SyncPreferences +import java.util.concurrent.TimeUnit class SyncYomiSyncService( context: Context, @@ -52,7 +53,12 @@ class SyncYomiSyncService( val apiKey = syncPreferences.syncAPIKey().get() val uploadUrl = "$host/api/sync/upload" - val client = OkHttpClient() + // Set timeout to 30 seconds + val client = OkHttpClient.Builder() + .connectTimeout(30, TimeUnit.SECONDS) + .readTimeout(30, TimeUnit.SECONDS) + .writeTimeout(30, TimeUnit.SECONDS) + .build() val headers = Headers.Builder().add( "Content-Type",