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

@@ -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()