Galarzaa90 / NabBot

Discord bot for Tibia servers
https://nabbot.xyz
Apache License 2.0
52 stars 25 forks source link

Enhance /deaths, /levels and /timeline timeout by caching call to get member #135

Closed Tschis closed 5 years ago

Tschis commented 5 years ago

Bot searches all entries to get first 100/200 visible entries for the user that executed the command.

Every entry would then execute a call into get_member, and this would take some time, which in turn could make the bot timeout while waiting.

By introducing the cache, the same members will not be searched repeatedly and the performance is increased a lot.

Tschis commented 5 years ago

PR modified to also add caching to /levels and /timeline, which suffered from the same bottleneck.

Galarzaa90 commented 5 years ago

Just wanted to add that, other than those minor details, this is a very good solution.

Galarzaa90 commented 5 years ago

Perfect, thanks!