Request De-duplication #476
Replies: 5 comments
-
@nilzgithub Hey, thanks for raising an issue, let me check it. Apologies for not getting back soon, COVID got me for a 2nd time. |
Beta Was this translation helpful? Give feedback.
-
@nilzgithub just a quick question, can you see if you are hitting this: https://github.com/fightmegg/riot-rate-limiter/wiki/Max-Retries Basically there is a retry limit when a 429 is encountered, explained here: https://github.com/fightmegg/riot-rate-limiter/wiki/429-Reponses |
Beta Was this translation helpful? Give feedback.
-
Hi @OllieJennings! No problem :) Get well soon - I had it once, it was horrible! I'm pretty sure im not hitting the max retries or at least it is not waiting for the retryAfter-Header as it seems, if I count correctly considering two summoners who NEVER played in a match with each other:
= 2 + 2 + 30 + 150 requests (correct me if Im wrong). All requests are made in around 2-5secs. I'm using the development key and rates are as follows:
The rate limit should be hit very quickly, but it looks like if all requests are made and retryAfter is skipped, since after few seconds I'll get those unhandled rejections. I noticed yesterday that at some point if the queue with requests adds up I get this message :
I guess thats because I need to find a way to keep track of which summonerIds are already in the queue and if so dont do the request again (do you have any idea how to do so?):
Also I'm not pretty sure how to inject the config to the rate-limiter, as I'm working with the fightmegg/riot-api. Would it be enough to just set |
Beta Was this translation helpful? Give feedback.
-
@nilzgithub From initial read through, i think you have found a potential issue, i think this library should handle duplicate requests, so that you don't get the error above. Basically, i think it should check to see if a job with the identical ID already exists (in queue), if so, ignore it, as you are already requesting it. |
Beta Was this translation helpful? Give feedback.
-
@OllieJennings sounds good, but I would leave it open to what happens to the duplicate ID/request (or at least configurable):
One additional thing I would like to see is to list which jobs are currently on the stack (async) (or in queue), if not possible already. |
Beta Was this translation helpful? Give feedback.
-
Hi @francois-blanchard @OllieJennings,
I started to use your library and faced a problem with an unhandled rejection after (as it seems) hitting the rate limit of the riot api:
Everthing seems to run fine, until the rate limit is kicking in. Ill get an unhandled promise, Ill catch it with the following listener:
The rejected message:
Do you know whats wrong here? It seems that the rate-limiter is not working properly.
Beta Was this translation helpful? Give feedback.
All reactions