fix: reorganization of files and folders

This commit is contained in:
Davidson Gomes
2024-04-12 17:13:15 -03:00
parent 794213b5c6
commit 8ece6fb998
125 changed files with 500 additions and 343 deletions

View File

@@ -0,0 +1,22 @@
import { CacheConf, ConfigService } from '../../../../config/env.config';
import { ICache } from '../../../abstract/abstract.cache';
import { LocalCache } from './localcache';
import { RedisCache } from './rediscache';
export class CacheEngine {
private engine: ICache;
constructor(private readonly configService: ConfigService, module: string) {
const cacheConf = configService.get<CacheConf>('CACHE');
if (cacheConf?.REDIS?.ENABLED && cacheConf?.REDIS?.URI !== '') {
this.engine = new RedisCache(configService, module);
} else if (cacheConf?.LOCAL?.ENABLED) {
this.engine = new LocalCache(configService, module);
}
}
public getEngine() {
return this.engine;
}
}