mirror of
https://github.com/MrSedan/neuro-reply-website.git
synced 2026-01-14 20:49:42 +03:00
Added redis
This commit is contained in:
19
backend/config/redis-options.ts
Normal file
19
backend/config/redis-options.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
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,
|
||||
};
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user