Skip to content
This repository has been archived by the owner on Mar 17, 2024. It is now read-only.

How to avoid 429s #344

Open
peebles opened this issue Oct 18, 2021 · 1 comment
Open

How to avoid 429s #344

peebles opened this issue Oct 18, 2021 · 1 comment

Comments

@peebles
Copy link

peebles commented Oct 18, 2021

I am doing

r.config({ continueAfterRatelimitError: true, requestDelay: 1000, debug: true });
r.getSubmission(ID).expandReplies({depth: 5}).then(data => { ... }

and eventually hitting 429 exception, which I expected to avoid. I believe it might be due to either (1) your rate limiting code is not considering many concurrently scheduled fetches, or (2) it is calling "morechildren" more than one at a time, where the reddit doc says (for morechildren): "NOTE: you may only make one request at a time to this API endpoint. Higher concurrency will result in an error being returned.", and maybe that is returning 429.

Or ... am I missing something here? I never want to take a 429 exception, no matter how long my script runs! How?

@peebles
Copy link
Author

peebles commented Oct 18, 2021

By the way, the submission id in question is "ohhg9t" if you want a test case.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant