Add rate limiting using Reddit RateLimit API response headers#71
Add rate limiting using Reddit RateLimit API response headers#71jfl88 wants to merge 16 commits intoj0be:masterfrom
Conversation
replace handle .then with .complete
|
Note: this pull request doesn't update version information or anything, I will leave that up to @j0be to decide how to handle any versioning or repo maintenance. |
|
Nice addition! Cleaning up an account with a lot of comments takes a long time when it requires manual intervention in an alert dialog every time it does not respect the rate limit. |
|
This is awesome! I was about to try to implement something in this fashion, since I want to let this running while I am not around, and having to confirm on the confirm popup was getting on my way. I changed the one-line script to point to your branch and changes: Thanks @jfl88 |
| pd.actions.page.next(); | ||
| } | ||
| const timeout = pd.helpers.getRateLimitTimeout(xhr); | ||
| console.log('timeout: ' + timeout); |
There was a problem hiding this comment.
I want to suggest this to be changed to: console.debug so one can hide these log lines from the main console's output...
I took @braboobssiere's development and also applied it to the handle function as well.
With this change all functions (search, edit, delete) will look at the RateLimit feedback from Reddit API and use it to set the timeout function period. When the response from Reddit is 5 queries remaining or less, it will wait for the reset period to expire before executing again.