summary refs log tree commit diff stats
path: root/lib/pure/httpclient.nim
diff options
context:
space:
mode:
authorZachary Marquez <zachmarquez@gmail.com>2022-01-08 03:22:56 -0600
committerGitHub <noreply@github.com>2022-01-08 10:22:56 +0100
commit58656aa5bba572672f093499280b69bb0f0d4c06 (patch)
tree9e5e692c17921758430ef91d6a65345b9a467e72 /lib/pure/httpclient.nim
parent4306d8fb36d3810b8d38a665f98dc89ce107740e (diff)
downloadNim-58656aa5bba572672f093499280b69bb0f0d4c06.tar.gz
fix nim-lang#19343 (#19344) [backport]
Ensure HttpClient onProgress is called once per second
Ensure that reported speed is accurate
Diffstat (limited to 'lib/pure/httpclient.nim')
-rw-r--r--lib/pure/httpclient.nim2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/pure/httpclient.nim b/lib/pure/httpclient.nim
index 7686d15bd..5b6e439db 100644
--- a/lib/pure/httpclient.nim
+++ b/lib/pure/httpclient.nim
@@ -673,7 +673,7 @@ proc reportProgress(client: HttpClient | AsyncHttpClient,
                     progress: BiggestInt) {.multisync.} =
   client.contentProgress += progress
   client.oneSecondProgress += progress
-  if (getMonoTime() - client.lastProgressReport).inSeconds > 1:
+  if (getMonoTime() - client.lastProgressReport).inSeconds >= 1:
     if not client.onProgressChanged.isNil:
       await client.onProgressChanged(client.contentTotal,
                                      client.contentProgress,