From ee86b9dc50accb95fefb12d2022d87661434a4c8 Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Fri, 21 Aug 2026 12:08:57 +0300 Subject: [PATCH] =?UTF-8?q?Revert=20"feat:=20retry=20=D0=BA=D0=BE=D0=BD?= =?UTF-8?q?=D0=B2=D0=B5=D1=80=D1=82=D0=B0=D1=86=D0=B8=D0=B8=20(2=20=D0=BF?= =?UTF-8?q?=D0=BE=D0=BF=D1=8B=D1=82=D0=BA=D0=B8)=20=D0=BF=D1=80=D0=B8=20fa?= =?UTF-8?q?iled/error"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit cbcd22f09c47c421bda665a9e3a2259f815f595c. --- .../binom/viewmate/phone/ui/DetailsScreen.kt | 32 +++---------------- 1 file changed, 4 insertions(+), 28 deletions(-) diff --git a/app-phone/src/main/kotlin/pw/binom/viewmate/phone/ui/DetailsScreen.kt b/app-phone/src/main/kotlin/pw/binom/viewmate/phone/ui/DetailsScreen.kt index e78ad11..a73f5e5 100644 --- a/app-phone/src/main/kotlin/pw/binom/viewmate/phone/ui/DetailsScreen.kt +++ b/app-phone/src/main/kotlin/pw/binom/viewmate/phone/ui/DetailsScreen.kt @@ -85,34 +85,10 @@ fun DetailsScreen( mirrorStatus = runCatching { app.mirror.mirrorByItem(item.Id) }.getOrNull() mirrorJob = runCatching { app.mirror.list(limit = 500).firstOrNull { it.itemId == item.Id } }.getOrNull() loading = false - var retryCount = 0 - while (true) { - when (mirrorStatus?.status) { - "processing", "queued" -> { - delay(3_000) - mirrorStatus = runCatching { app.mirror.mirrorByItem(item.Id) }.getOrNull() - mirrorJob = runCatching { app.mirror.list(limit = 500).firstOrNull { it.itemId == item.Id } }.getOrNull() - retryCount = 0 - } - "done" -> { - break - } - "failed", "error" -> { - if (retryCount < 2) { - retryCount++ - log("mirror", "конвертация упала, retry $retryCount/2 для ${item.Id}") - runCatching { app.mirror.createMirror(item.Id) } - .onSuccess { refreshKey++ } - .onFailure { e -> log("mirror", "retry $retryCount не удался: ${e.message}") } - delay(5_000) - } else { - break - } - } - else -> { - break - } - } + while (mirrorStatus?.status == "processing" || mirrorStatus?.status == "queued") { + delay(3_000) + mirrorStatus = runCatching { app.mirror.mirrorByItem(item.Id) }.getOrNull() + mirrorJob = runCatching { app.mirror.list(limit = 500).firstOrNull { it.itemId == item.Id } }.getOrNull() } }