Fix image not retrying

This commit is contained in:
tom5079
2022-07-20 09:04:23 -07:00
parent c9519ec681
commit 3682eeaf94
3 changed files with 6 additions and 5 deletions

View File

@@ -38,7 +38,7 @@ android {
minSdkVersion 16
targetSdkVersion 32
versionCode 69
versionName "5.3.8"
versionName "5.3.8-hotfix1"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}

View File

@@ -12,7 +12,7 @@
"filters": [],
"attributes": [],
"versionCode": 69,
"versionName": "5.3.8",
"versionName": "5.3.8-hotfix1",
"outputFile": "app-release.apk"
}
],

View File

@@ -171,7 +171,7 @@ class DownloadService : Service() {
var response = kotlin.runCatching {
chain.proceed(request)
}.getOrNull()
var limit = 5
var limit = 10
while (response?.isSuccessful != true) {
if (response?.code() == 503) {
@@ -184,9 +184,10 @@ class DownloadService : Service() {
}.getOrNull()
}
checkNotNull(response)
if (response == null)
response = chain.proceed(request)
response.newBuilder()
response!!.newBuilder()
.body(response.body()?.let {
ProgressResponseBody(request.tag(), it, progressListener)
}).build()