knights-of-academia / horace

discord.js bot powering the Knights of Academia server with commands like info, AFK, and more
MIT License
23 stars 19 forks source link

Add a safeguard to protect against spamming database calls #255

Closed debashisbiswas closed 3 years ago

debashisbiswas commented 3 years ago

Currently, there are a few functions that run periodically: reminders and ToC reminders. In the config file, these are set to run every x milliseconds. There should be a safeguard added that stops these functions from getting run too quickly. This will avoid piling up calls to the database. For example, if the value is not specified in the config file, the function will be set to run every 0 milliseconds - this should not be allowed.