Hey, I think what you want to do instead is to limit the amount of requests you make, not the amount of requests you recieve, such that you keep the user waiting until you are able to make new requests (and don't make the user hit the refresh button) Because otherwise you could just display a nice error message whenever you recieve an error from the API, and be done with it.
In that case this question is better asked on the forums/mailinglists/channels for requests (i assume you use that to call that third-party API). I also found these: https://stackoverflow.com/questions/20247354/limiting-throttling-the-rate-of-http-requests-in-grequests http://flask.pocoo.org/snippets/70/ On Sat, Apr 12, 2014 at 04:25:58AM -0700, Ashutosh Das wrote: > My problem is that I am using a 3rd party API which accept just 5 call/sec. > So how can I determine that if there is more than 5 call/sec is going or > not in Flask or just count GET request for specific route ? > > -- > You received this message because you are subscribed to the Google Groups > "pocoo-libs" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/pocoo-libs. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "pocoo-libs" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/pocoo-libs. For more options, visit https://groups.google.com/d/optout.
