mirror of
https://github.com/f-droid/fdroidclient.git
synced 2026-04-18 22:08:49 -04:00
[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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user