gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-wallet-core] branch master updated: max->min


From: gnunet
Subject: [taler-wallet-core] branch master updated: max->min
Date: Mon, 09 Dec 2019 13:46:37 +0100

This is an automated email from the git hooks/post-receive script.

dold pushed a commit to branch master
in repository wallet-core.

The following commit(s) were added to refs/heads/master by this push:
     new 99bccae9 max->min
99bccae9 is described below

commit 99bccae9fe1588f711e7606dc3c6d7dd4a25675a
Author: Florian Dold <address@hidden>
AuthorDate: Mon Dec 9 13:46:28 2019 +0100

    max->min
---
 src/util/RequestThrottler.ts | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/util/RequestThrottler.ts b/src/util/RequestThrottler.ts
index 48a60729..d44109be 100644
--- a/src/util/RequestThrottler.ts
+++ b/src/util/RequestThrottler.ts
@@ -51,9 +51,9 @@ class OriginState {
   private refill(): void {
     const now = getTimestampNow();
     const d = now.t_ms - this.lastUpdate.t_ms;
-    this.tokensSecond = Math.max(MAX_PER_SECOND, this.tokensSecond + (d / 
1000));
-    this.tokensMinute = Math.max(MAX_PER_MINUTE, this.tokensMinute + (d / 1000 
* 60));
-    this.tokensHour = Math.max(MAX_PER_HOUR, this.tokensHour + (d / 1000 * 60 
* 60));
+    this.tokensSecond = Math.min(MAX_PER_SECOND, this.tokensSecond + (d / 
1000));
+    this.tokensMinute = Math.min(MAX_PER_MINUTE, this.tokensMinute + (d / 1000 
* 60));
+    this.tokensHour = Math.min(MAX_PER_HOUR, this.tokensHour + (d / 1000 * 60 
* 60));
     this.lastUpdate = now;
   }
 

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]