kevinrue / lolgenie

Client for the RIOT Games API
1 stars 1 forks source link

Store some queries server wide like champion names #36

Open cyrlop opened 3 years ago

cyrlop commented 3 years ago

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.