feat: 实现批量生码、二维码导出与公开溯源激活计数
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import { Global, Module } from '@nestjs/common';
|
||||
import { ConfigService } from '@nestjs/config';
|
||||
import Redis from 'ioredis';
|
||||
|
||||
export const REDIS_CLIENT = 'REDIS_CLIENT';
|
||||
|
||||
@Global()
|
||||
@Module({
|
||||
providers: [
|
||||
{
|
||||
provide: REDIS_CLIENT,
|
||||
inject: [ConfigService],
|
||||
useFactory: (config: ConfigService) =>
|
||||
new Redis({
|
||||
host: config.get<string>('redis.host'),
|
||||
port: config.get<number>('redis.port'),
|
||||
password: config.get<string>('redis.password') || undefined,
|
||||
maxRetriesPerRequest: null,
|
||||
}),
|
||||
},
|
||||
],
|
||||
exports: [REDIS_CLIENT],
|
||||
})
|
||||
export class RedisModule {}
|
||||
Reference in New Issue
Block a user