ratelimit

Celery: Rate limit on tasks with the same parameters

微笑、不失礼 提交于 2021-02-15 05:52:37
问题 I am looking for a way to restrict when a function is called, but only when the input parameters are different, that is: @app.task(rate_limit="60/s") def api_call(user): do_the_api_call() for i in range(0,100): api_call("antoine") api_call("oscar") So I would like api_call("antoine") to be called 60 times per second and api_call("oscar") 60 times per second as well. Any help on how can I do that? --EDIT 27/04/2015 I have tried calling a subtask with rate_limit within a task, but it does not

Celery: Rate limit on tasks with the same parameters

半世苍凉 提交于 2021-02-15 05:50:48
问题 I am looking for a way to restrict when a function is called, but only when the input parameters are different, that is: @app.task(rate_limit="60/s") def api_call(user): do_the_api_call() for i in range(0,100): api_call("antoine") api_call("oscar") So I would like api_call("antoine") to be called 60 times per second and api_call("oscar") 60 times per second as well. Any help on how can I do that? --EDIT 27/04/2015 I have tried calling a subtask with rate_limit within a task, but it does not

How to change the rate limit whilst using a RateGate?

半城伤御伤魂 提交于 2020-02-04 03:52:27
问题 I am using the concise RateGate class to limit the number of requests I send to a server. My code looks something like this: var RateLimit = 35; using(var RateGate = new RateGate(RateLimit, TimeSpan.FromSeconds(1))) { for(var Run = 1; Run <= 50; Run++) { for(var Batch = 0; Batch < 200; Batch++) { // Do some work, then... MyClass MyClass; if(MyClass.RateLimitHit) { RateLimit--; } RateGate.WaitToProceed(); } } } Inside the if(MyClass.RateLimitHit) , I need to lower the rate limit by 1. Not just

How do I know if my IP is blacklisted for Deezer API?

眉间皱痕 提交于 2019-12-24 10:46:36
问题 On my local machine, I visit the url http://api.deezer.com/2.0/search/artist?q=feeder and get the correct json data returned. On my live server, I curl the same url, and get returned the json. {"data":[],"total":0} http status code is 200, and I don't believe I've hit the rate limit, having tested on my local machine with a similar load. I can only suspect that someone else on the server (On a shared host here), has hit the API and got blacklisted, or they still respond when a rate limit is

Facebook python sdk uses marketing api or graph api

杀马特。学长 韩版系。学妹 提交于 2019-12-11 04:05:59
问题 I have been using facebook python SDK for nearly 6 months for building a product. I have dev access for the marketing api. It frequently errors out saying Rate limit has exceeded. But when i check marketing api dashboard it says not enough data available. So Im really confused whether SDK uses marketing API or graph API. Can anybody explain me the usage. Any info will be much appreciated. 来源: https://stackoverflow.com/questions/51479955/facebook-python-sdk-uses-marketing-api-or-graph-api

Spotify automated playlist management with PHP back-end and rate limits

烈酒焚心 提交于 2019-12-07 19:32:48
问题 Two questions: Question 1. We need to manage 4 playlists of a Spotify user from our back-end (PHP) (without user login) . Visitors of our website can submit multiple of their favorite songs to our websites. Based on that, we create and manage 4 playlists which contain the ‘top most submitted songs’. We want to automate this process from our PHP back-end without the need of manually managing the playlist day to day for a period of multiple months. We would like to use the Spotify API for this,