From 14a04fab29f338228cffe815e6f82d99583f6de6 Mon Sep 17 00:00:00 2001 From: ferkans-amir Date: Mon, 27 Jul 2026 12:16:51 +0200 Subject: [PATCH] perf(epic): back off idle download polling when no downloads are active --- Sources/EpicLandingView.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Sources/EpicLandingView.swift b/Sources/EpicLandingView.swift index 2b9ddb7..980da41 100644 --- a/Sources/EpicLandingView.swift +++ b/Sources/EpicLandingView.swift @@ -142,7 +142,8 @@ struct EpicLandingView: View { } // Keep polling downloads; refresh library only when a download is active. while !Task.isCancelled { - try? await Task.sleep(nanoseconds: 3_000_000_000) + let delay: UInt64 = backend.epicDownloads.isEmpty ? 10_000_000_000 : 3_000_000_000 + try? await Task.sleep(nanoseconds: delay) guard !Task.isCancelled, backend.activePrefix == prefix else { break } await backend.refreshEpicDownloads() if !backend.epicDownloads.isEmpty {