fix: clear setting cache once seeded

This commit is contained in:
Mohamed Marrouchi
2024-10-23 08:23:25 +01:00
parent 16c4852d67
commit 5524d3c4c0
2 changed files with 19 additions and 3 deletions

View File

@@ -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();
}
/**