mirror of
https://github.com/hexastack/hexabot
synced 2025-06-26 18:27:28 +00:00
fix: clear setting cache once seeded
This commit is contained in:
@@ -105,13 +105,20 @@ export class SettingService extends BaseService<Setting> {
|
||||
return config;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears the settings cache
|
||||
*/
|
||||
async clearCache() {
|
||||
this.cacheManager.del(SETTING_CACHE_KEY);
|
||||
}
|
||||
|
||||
/**
|
||||
* Event handler for setting updates. Listens to 'hook:setting:*' events
|
||||
* and invalidates the cache for settings when triggered.
|
||||
*/
|
||||
@OnEvent('hook:setting:*')
|
||||
async handleSettingUpdateEvent() {
|
||||
this.cacheManager.del(SETTING_CACHE_KEY);
|
||||
this.clearCache();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user