refactor: Rename initializeAppConfig to setAppConfig and update related tests

This commit is contained in:
Danny Avila 2025-08-17 18:03:14 -04:00
parent eeab69ff7f
commit 2501d11fa0
No known key found for this signature in database
GPG key ID: BF31EEB2C5CA0956
4 changed files with 85 additions and 108 deletions

View file

@ -70,17 +70,6 @@ async function getAppConfig(options = {}) {
return baseConfig;
}
/**
* Cache the app configuration
* @param {AppConfig} config - The configuration to cache
* @returns {Promise<void>}
*/
async function cacheAppConfig(config) {
const cache = getLogStores(CacheKeys.CONFIG_STORE);
await cache.set(CacheKeys.APP_CONFIG, config);
logger.debug('[getAppConfig] App configuration cached');
}
/**
* Clear the app configuration cache
* @returns {Promise<boolean>}
@ -96,7 +85,7 @@ async function clearAppConfigCache() {
* @param {AppConfig} config - The initial configuration to store
* @returns {Promise<void>}
*/
async function initializeAppConfig(config) {
async function setAppConfig(config) {
const cache = getLogStores(CacheKeys.CONFIG_STORE);
await cache.set(CacheKeys.APP_CONFIG, config);
logger.debug('[getAppConfig] App configuration initialized');
@ -104,7 +93,6 @@ async function initializeAppConfig(config) {
module.exports = {
getAppConfig,
cacheAppConfig,
setAppConfig,
clearAppConfigCache,
initializeAppConfig,
};