Open LAMaglan opened 2 months ago
Can maybe introduce caching, which means I can keep calling get_pokemon in multiple areas as is. BUT, caching with concurrent/asynchronous requests are not so trivial (at least in terms of "normal" caching)
Can investigate fastapi-cache . But am not sure that it is worth it in the end (this is not a computationally heavy process), but can try
Can cache asynchronous functions with fastapi-cache in combination with aioredis. However, would then need to run an instance of aioredis, which is not really worth it in this case.
"get_pokemon" is called separately for "/battle" and "/pokemon_stats" endpoint. How would I consolidate it?
Could make a global list that stores each Pokemon with all details that I fetch from? Or? Initial button for "use pokemon", and then only show "show stats" and "Battle!" ?
May "solve" stats_modifier here https://github.com/LAMaglan/PokeFightSimulator/issues/64