This repository has been archived on 2024-06-14. You can view files and clone it, but cannot push or open issues or pull requests.
icynet-auth-server/src/modules/cache/cache.module.ts

22 lines
525 B
TypeScript
Raw Normal View History

2024-03-12 15:49:06 +00:00
import { CacheModule } from '@nestjs/cache-manager';
import { Module } from '@nestjs/common';
import { redisStore } from 'cache-manager-redis-yet';
import { RedisModule } from '../redis/redis.module';
@Module({
imports: [
CacheModule.registerAsync({
imports: [RedisModule],
useFactory: (redisUrl: string) => {
return {
store: redisStore,
url: redisUrl,
};
},
inject: ['REDIS_URL'],
}),
],
exports: [CacheModule],
})
export class CommonCacheModule {}