fix: 更新功能
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { Redis } from 'ioredis';
|
||||
import { useConfig } from '@kevisual/use-config';
|
||||
|
||||
import { useContextKey } from '@kevisual/use-config/context';
|
||||
const config = useConfig<{
|
||||
redis: ConstructorParameters<typeof Redis>;
|
||||
}>();
|
||||
@@ -18,7 +18,7 @@ export const redis = new Redis({
|
||||
maxRetriesPerRequest: null, // 允许请求重试的次数 (如果需要无限次重试)
|
||||
...config.redis,
|
||||
});
|
||||
|
||||
useContextKey('redis', () => redis);
|
||||
// 监听连接事件
|
||||
redis.on('connect', () => {
|
||||
console.log('Redis 连接成功');
|
||||
|
||||
Reference in New Issue
Block a user