Currently, when data is obtained from the Google Sheets Microservice, the CachedGoogleSheetsApiService class will "cache" the data in a runtime variable, which will be retained until the bot restarts. However, there are times where data will be updated in a spreadsheet and we want the bot to be able to use that new data immediately.
There should be a command under /ptu or /ptu_admin (once the command exists) to allow the bot to clear the cache when given a specific key, so that specific data can be cleared without clearing the whole cache. This will allow us to successfully retrieve the new data the next time it's requested.
Currently, when data is obtained from the Google Sheets Microservice, the
CachedGoogleSheetsApiService
class will "cache" the data in a runtime variable, which will be retained until the bot restarts. However, there are times where data will be updated in a spreadsheet and we want the bot to be able to use that new data immediately.There should be a command under
/ptu
or/ptu_admin
(once the command exists) to allow the bot to clear the cache when given a specific key, so that specific data can be cleared without clearing the whole cache. This will allow us to successfully retrieve the new data the next time it's requested.The below method should clear the cache sufficiently. It just needs called by the new subcommand. https://github.com/beanc16/roll-of-darkness-bot/blob/a9e57c39543301dcce0036b86cc09318c7f52986/src/services/CachedGoogleSheetsApiService.ts#L277-L281