-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
order status check via API throws error #19
Comments
Are you sending other requests meanwhile? Because the cap is for all the request, not for a single call. |
Yes there is no other instance running and the checkStatus is called every 5 secs. I still see this issue on and off. |
Try to debug, with "console.log("Calls in last minute: " + this.callsInLastMinute)" in line 83 of Bitstamp.js. |
The logic is straight forward, as tuloski has explained. I suspect you are calling more then 15 times. However besides debugging you can disable this behaviour by setting "rateLimit" to false in the options you pass the constructor - but this will return in API errors if you make to many calls. |
@tuloski @krystianity I have just added this console.log and it helped in reproducing the issue. From the logs its clear that the timer held by node-bitstamp doesn't reset after a minute in one of the cases and hence this issue pops up. Check the log snippet below to verify the counter incrementing even after 1 minute has passed and hence starts throwing error. This however does happen in 1 in 20 iterations. |
I tried and it resets for me. |
It does reset for me 19 out of 20 times .... but once in a while it does not ...as seen in the log attached and then it starts giving error. |
I'm not a big fan of setInterval, because they are known to create problems. |
You refering to setInterval inside library?
|
Yeah...that should reset the calls per minute every minute. |
Hi,
Whenever i check for an orders status using
await bitstamp.orderStatus(orderId).then(({status, headers, body}) => body);
I keep getting following error even if i run it at 5 sec intervals:
Its run 15 times in 60000ms still i get this error. what could be wrong here?
The text was updated successfully, but these errors were encountered: