mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-18 09:20:15 +01:00
🔧 refactor: Enhance cached endpoints config handling for GPT plugins
This commit is contained in:
parent
877c67e295
commit
b0eaa1d40f
1 changed files with 5 additions and 1 deletions
|
|
@ -19,7 +19,11 @@ async function getEndpointsConfig(req) {
|
||||||
const cache = getLogStores(CacheKeys.CONFIG_STORE);
|
const cache = getLogStores(CacheKeys.CONFIG_STORE);
|
||||||
const cachedEndpointsConfig = await cache.get(CacheKeys.ENDPOINT_CONFIG);
|
const cachedEndpointsConfig = await cache.get(CacheKeys.ENDPOINT_CONFIG);
|
||||||
if (cachedEndpointsConfig) {
|
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 }));
|
const appConfig = req.config ?? (await getAppConfig({ role: req.user?.role }));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue