mirror of
https://github.com/Wei-Shaw/claude-relay-service.git
synced 2026-01-22 16:43:35 +00:00
feat: 修复 userMessageQueue 配置缺失导致的 500 错误
- 在 config.example.js 添加缺失的 userMessageQueue 配置段 - 在 userMessageQueueService.js 添加防御性代码,当配置未定义时使用默认值 修复 #783 合并后新用户安装报错: Cannot read properties of undefined (reading 'enabled')
This commit is contained in:
@@ -203,6 +203,14 @@ const config = {
|
||||
development: {
|
||||
debug: process.env.DEBUG === 'true',
|
||||
hotReload: process.env.HOT_RELOAD === 'true'
|
||||
},
|
||||
|
||||
// 📬 用户消息队列配置
|
||||
userMessageQueue: {
|
||||
enabled: process.env.USER_MESSAGE_QUEUE_ENABLED === 'true', // 默认关闭
|
||||
delayMs: parseInt(process.env.USER_MESSAGE_QUEUE_DELAY_MS) || 100, // 请求间隔(毫秒)
|
||||
timeoutMs: parseInt(process.env.USER_MESSAGE_QUEUE_TIMEOUT_MS) || 60000, // 队列等待超时(毫秒)
|
||||
lockTtlMs: 120000 // 锁租约TTL(毫秒),会在请求期间自动续租以防死锁
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user