Files
neuro-reply-website/backend/config/redis-options.ts
2024-02-13 23:11:34 +03:00

20 lines
571 B
TypeScript

import { CacheModuleAsyncOptions } from '@nestjs/cache-manager';
import { redisStore } from 'cache-manager-redis-store';
import { config } from 'config';
export const RedisOptions: CacheModuleAsyncOptions = {
isGlobal: true,
useFactory: async () => {
const store = await redisStore({
socket: {
host: config.redis.redis_host,
port: config.redis.redis_port,
passphrase: config.redis.redis_password,
},
});
return {
store: () => store,
};
},
};