fix: 更新功能

This commit is contained in:
2025-03-06 19:02:24 +08:00
parent 2f166817df
commit 16722f1d1d
8 changed files with 75 additions and 20 deletions

View File

@@ -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 连接成功');