[download] limit download progress reporting to once per second

More often isn't needed and runs into issues with UI refresh rates and worse notification rate-limiting which causes important notifications to get missed
This commit is contained in:
Torsten Grote
2025-10-01 08:47:02 -03:00
parent 4579b82a4c
commit c5cdcdfd3f

View File

@@ -180,7 +180,7 @@ public abstract class Downloader(
private fun reportProgress(lastTimeReported: Long, bytesRead: Long, bytesTotal: Long): Long {
val now = System.currentTimeMillis()
return if (now - lastTimeReported > 100) {
return if (now - lastTimeReported > 1000) {
log.debug { "onProgress: $bytesRead/$bytesTotal" }
progressListener?.onProgress(bytesRead, bytesTotal)
now