This commit is contained in:
2025-12-04 14:22:04 +08:00
parent 2a55f2d3ef
commit 9e458f4a77
17 changed files with 449 additions and 143 deletions

View File

@@ -3,7 +3,6 @@ import { useConfig } from '@kevisual/use-config';
import { useContextKey } from "@kevisual/context";
export const config = useConfig()
// 首先从 process.env 读取环境变量
const redisConfig = {
host: process.env.REDIS_HOST || 'kevisual.cn',
@@ -27,14 +26,14 @@ export const createRedisClient = (options = {}) => {
});
// 监听连接事件
redis.on('connect', () => {
console.log('Redis 连接成功');
// console.log('Redis 连接成功');
});
redis.on('error', (err) => {
console.error('Redis 连接错误', err);
// console.error('Redis 连接错误', err);
});
redis.on('ready', () => {
console.log('Redis 已准备好处理请求');
// console.log('Redis 已准备好处理请求');
});
return redis;
};