Je rencontre un problème avec la création de catégories via l’API. Il semble qu’il existe une limite, mais celle-ci ne semble ni personnalisable ni désactivable via un paramètre quelconque.
L’erreur que je reçois est : Nous avons une limite quotidienne sur le nombre de fois où cette action peut être effectuée. Veuillez attendre 17 secondes avant de réessayer.
Le nombre de secondes semble toujours être inférieur à 20 secondes, mais il n’est jamais précis car il est indiqué qu’il s’agit d’une limite quotidienne, et j’ai essayé moins d’une minute après la dernière tentative. J’ai également essayé d’ajuster TOUTES les limites de débit dans le tableau de bord d’administration à 1000+, mais aucune d’elles ne semble affecter la création de catégories.
Les seules limites de débit disponibles dans le tableau de bord sont : sujets maximum, messages privés, likes, signets, drapeaux, modifications, invitations, invitations à des sujets, sujets, impressions et connexions.
Est-ce que je manque quelque chose ? Ce message ne provient pas non plus de nginx, car le message émane de Discourse et le modèle de limitation de débit pour nginx a été désactivé.
Ahh, it’s new, didn’t notice that either. Not on top of it today I guess…
I’m only performing one request though to create a category and don’t see any daily limits there. Is there another limit that would be attributing to the 429 error?
Well first thing I would try is another API endpoint to see if this is the global rate limit or some specific rate limit on category creation (or maybe a user rate limit in the app), be sure your api_username is an admin
Not seeing anything particular in the app, I would try a different admin user to see what happens, maybe the error you are getting is a different limit.
{"errors"=>["We have a daily limit on how many times that action can be taken. Please wait 21 seconds before trying again."], "error_type"=>"rate_limit"} (DiscourseApi::TooManyRequests)
Running 2.0.0.beta1. Not aware of anything looping, only I have access to these keys and the script that runs them is ran manually by me as I’m developing something to automate creating categories. I have 1 call to get the existing category lists, then one call per category creation (only 1 category right now). It has worked to create most of the categories before the rate limit got hit.
The ‘seconds’ varies; often 12, 17, 21, or other amount around that amount.
Yup… you appear to have been right! A variable wasn’t being set when it needed to be, so it was bypassing a check I had. Seems to be working fine now, no hammering the API anymore. Still good to know the info you posted though, so I appreciate that.
Hey @sam, could you point me to where I can disable the global admin api limit? I have a script to pull response times that requires getting all the topics in a timeframe and then for each topic, getting all of the posts for the topic, and I keep running into the rate limiting (You’ve performed this action too many times. Please wait 6 seconds before trying again.').
Apologies if this old thread i dug up is now really out of date