MCPcopy Index your code
hub / github.com/directus/directus / getConfig

Function getConfig

api/src/cache.ts:208–220  ·  view source on GitHub ↗
(store: Store = 'memory', ttl: number | undefined, namespaceSuffix = '')

Source from the content-addressed store, hash-verified

206}
207
208function getConfig(store: Store = 'memory', ttl: number | undefined, namespaceSuffix = ''): KeyvOptions {
209 const config: KeyvOptions = {
210 namespace: `${env['CACHE_NAMESPACE']}${namespaceSuffix}`,
211 ...(ttl && { ttl }),
212 };
213
214 if (store === 'redis') {
215 const { default: KeyvRedis } = require('@keyv/redis');
216 config.store = new KeyvRedis(env['REDIS'] || getConfigFromEnv('REDIS'), { useRedisSets: false });
217 }
218
219 return config;
220}

Callers 1

getKeyvInstanceFunction · 0.70

Calls 1

getConfigFromEnvFunction · 0.85

Tested by

no test coverage detected