The "one time" query like getting the champion names could be done only once when the server load and be store either in Settings instance or in a similar class like RiotData.
This kind of queries shouldn't be done at every request:
champions = riot.get_champions(release=settings.latest_release)
champ_ids_to_names = riot.get_champions_map(champions, key="key", value="id")
The only downside is when riot adds a new champion, this won't be updated until we reload the server, but that can be solved by adding an update_settings or update_riot_data function somewhere.
The "one time" query like getting the champion names could be done only once when the server load and be store either in
Settings
instance or in a similar class likeRiotData
.This kind of queries shouldn't be done at every request:
The only downside is when riot adds a new champion, this won't be updated until we reload the server, but that can be solved by adding an
update_settings
orupdate_riot_data
function somewhere.