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

Function getKeyvInstance

api/src/cache.ts:198–206  ·  view source on GitHub ↗
(store: Store, ttl: number | undefined, namespaceSuffix?: string)

Source from the content-addressed store, hash-verified

196}
197
198function getKeyvInstance(store: Store, ttl: number | undefined, namespaceSuffix?: string): Keyv {
199 switch (store) {
200 case 'redis':
201 return new Keyv(getConfig('redis', ttl, namespaceSuffix));
202 case 'memory':
203 default:
204 return new Keyv(getConfig('memory', ttl, namespaceSuffix));
205 }
206}
207
208function getConfig(store: Store = 'memory', ttl: number | undefined, namespaceSuffix = ''): KeyvOptions {
209 const config: KeyvOptions = {

Callers 1

getCacheFunction · 0.85

Calls 1

getConfigFunction · 0.70

Tested by

no test coverage detected