fix:修复限流后未自动恢复调度的问题

This commit is contained in:
shaw
2025-09-13 22:24:56 +08:00
parent 4a568f75bb
commit aabf909c61
2 changed files with 19 additions and 7 deletions

View File

@@ -180,11 +180,17 @@ class RateLimitCleanupService {
*/
async cleanupClaudeAccounts(result) {
try {
const accounts = await claudeAccountService.getAllAccounts()
// 使用原始数据而不是处理过的数据,避免字段被转换
const redis = require('../models/redis')
const accounts = await redis.getAllClaudeAccounts()
for (const account of accounts) {
// 检查标记为限流的账号
if (account.rateLimitStatus === 'limited' || account.rateLimitedAt) {
// 检查所有可能处于限流状态的账号,包括自动停止的账号
if (
account.rateLimitStatus === 'limited' ||
account.rateLimitedAt ||
account.rateLimitAutoStopped === 'true'
) {
result.checked++
try {