core icon indicating copy to clipboard operation
core copied to clipboard

Implement mutex for outgoing API calls

Open builder-247 opened this issue 5 years ago • 0 comments

Currently if multiple requests are made close to each other that require using Mojang or Hypixel APIs, multiple requests are sent. For example when viewing uncached player's stats via Slothpixel UI, 2 requests are sent to Mojang API resolving the username. This behaviour has many disadvantages - rate limits & resources are used unnecessarily.

Ideally when this happens, only one request is sent and the other data consumers wait for the original API response.

The state should be managed with redis for example, allowing multiple web instances to coexist sharing the mutex.

builder-247 avatar Mar 15 '20 15:03 builder-247