🔧 refactor: Enhance cached endpoints config handling for GPT plugins

This commit is contained in:
Danny Avila 2025-12-15 16:22:41 -05:00
parent 877c67e295
commit b0eaa1d40f
No known key found for this signature in database
GPG key ID: BF31EEB2C5CA0956

View file

@ -19,7 +19,11 @@ async function getEndpointsConfig(req) {
const cache = getLogStores(CacheKeys.CONFIG_STORE);
const cachedEndpointsConfig = await cache.get(CacheKeys.ENDPOINT_CONFIG);
if (cachedEndpointsConfig) {
return cachedEndpointsConfig;
if (cachedEndpointsConfig.gptPlugins) {
await cache.delete(CacheKeys.ENDPOINT_CONFIG);
} else {
return cachedEndpointsConfig;
}
}
const appConfig = req.config ?? (await getAppConfig({ role: req.user?.role }));