MCPcopy Create free account
hub / github.com/evolution-foundation/evolution-api / constructor

Method constructor

src/cache/cacheengine.ts:13–26  ·  view source on GitHub ↗
(
    private readonly configService: ConfigService,
    module: string,
  )

Source from the content-addressed store, hash-verified

11 private engine: ICache;
12
13 constructor(
14 private readonly configService: ConfigService,
15 module: string,
16 ) {
17 const cacheConf = configService.get<CacheConf>('CACHE');
18
19 if (cacheConf?.REDIS?.ENABLED && cacheConf?.REDIS?.URI !== '') {
20 logger.verbose(`RedisCache initialized for ${module}`);
21 this.engine = new RedisCache(configService, module);
22 } else if (cacheConf?.LOCAL?.ENABLED) {
23 logger.verbose(`LocalCache initialized for ${module}`);
24 this.engine = new LocalCache(configService, module);
25 }
26 }
27
28 public getEngine() {
29 return this.engine;

Callers

nothing calls this directly

Calls 2

verboseMethod · 0.80
getMethod · 0.65

Tested by

no test coverage detected