Comments (3)
@hubroot from what I see from their documentation the 429 code is when you hit the rate limiter.. ergo (HTTP 429 return code is used when breaking a request rate limit.)
Why would you want to retry if you hit that? Just implement your code in a way you don't hit the limiter.
from py3cw.
@bogdanteodoru yeah, i mean some internal check of the error code, if it's 429, the user can set their python code to get data from some cache.
Imagine you request the API accounts endpoint every 5 minutes, it's better to save at least the latest successful response in some kind of database or cache to keep the app working.
accounts = api.get('accounts', on_429_error= function(){ database.get('last saved account')}
from py3cw.
@hubroot you could easily store that on a local variable as well if you want to keep track of a previous state. I mean, it would be an extra step from your end, of course but I would rather inform you that you hit the limit. The caching itself can be done by a local fallback function or variable that actually doing it on the library.
I wouldn't implement this at the current point as I see it more flexible to use other caching libraries or just a state variable outside the library but if this will become a pain in the ass or requested by multiple people, I will reconsider.
I will close this for now. Thanks for your input.
from py3cw.
Related Issues (20)
- Smart Trade - Signature is invalid HOT 1
- Smart trade v2
- Feature Request: allow for action_id to be of type int HOT 2
- Can't create grid bot on Binance Futures Coin account HOT 1
- "copy_and_create" not included among API_METHODS for "bots" actions HOT 2
- Where can I get action_id and bot id and how do I create them? HOT 1
- accounts/market_pairs returns empty list HOT 1
- Search for available bots and enable at least 1
- How to make a purchase with trailing?
- What happens when API Limit is reached HOT 5
- @verify_request breaks arguments defaults and backward compatibility HOT 1
- On failed request add status code to the error object HOT 1
- On error the wrapper could return both {} and None HOT 2
- Syntax error in request.py", line 14 HOT 3
- Historical data HOT 1
- missing "users" actions HOT 1
- New endpoints not in config, proposal for more future proof HOT 1
- Exceeded 30 redirects ERROR
- No module named 'Crypto' HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from py3cw.