wankdanker / node-function-rate-limit

Rate Limit any Function in node
68 stars 9 forks source link

Calling More Frequent Than Rate Limit #2

Closed payomdousti closed 9 years ago

payomdousti commented 9 years ago
var throttledCreateRequest = rateLimit(25, 1000, function(url, callback) {
  createRequest(url, callback);
}

Here are the sample time intervals sampled at each interval of 26 calls (my set limit + 1). These should all be > 1000ms, but they are not.

1413755960840 - 1413755959827 = 1013 1413755961840 - 1413755960840 = 1000 1413755962803 - 1413755961840 = 963 1413755963806 - 1413755962803 = 1003 1413755964769 - 1413755963806 = 963 1413755965783 - 1413755964769 = 1014 1413755966754 - 1413755965783 = 971 1413755960879 - 1413755959867 = 1012 1413755961879 - 1413755960879 = 1000 1413755962844 - 1413755961879 = 965 1413755963846 - 1413755962844 = 1002 1413755964811 - 1413755963846 = 965 1413755965824 - 1413755964811 = 1013

wankdanker commented 9 years ago

Since bursting has been enabled in db486cab, this shouldn't be a problem any more.