Enhancement/rate limit api switcher #476
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR implements an alternate query mechanism as discussed in #449
When rate limits per session kicks in - then the code is essentially given an upper bound on number of refreshes by CoWIN. To improve the odds, we implement checks in between / more frequent than what the ratelimit allows us, using the Public API.
This way - the performance is no worse off than the max capability in the usual protected API method. But just in case the public API lists that slot - we're going to lap it up.
I tested a couple of cases, esp when slots were being released. When slots are being released - this is a hit or miss - it may show availability immediately on the public API, or it may not show up at all (directly being listed as fully booked).
@Nakul93 @6mxo89sqh