perf: optimize screen load times with progressive un-gating and SWR caching (#1192)

This commit is contained in:
M57
2026-09-18 23:25:30 +03:00
committed by GitHub
parent abce60ad7a
commit f5eaecbbef
55 changed files with 2494 additions and 401 deletions
@@ -1,5 +1,6 @@
package com.m57.hermescontrol.data.remote
import kotlinx.coroutines.CancellationException
import kotlinx.coroutines.delay
import kotlinx.serialization.json.jsonObject
import kotlinx.serialization.json.jsonPrimitive
@@ -132,6 +133,8 @@ suspend inline fun <reified T> safeApiCall(
}
val backoff = jitteredBackoff(500L * (1 shl attempt))
delay(backoff)
} catch (e: CancellationException) {
throw e
} catch (e: Exception) {
return NetworkResult.Failure(
NetworkError.Unknown(