mirror of
https://github.com/Wei-Shaw/claude-relay-service.git
synced 2026-01-23 09:38:02 +00:00
feat: claude账户支持使用统一的客户端标识
This commit is contained in:
18
src/app.js
18
src/app.js
@@ -537,6 +537,15 @@ class Application {
|
||||
logger.info(
|
||||
`🔄 Cleanup tasks scheduled every ${config.system.cleanupInterval / 1000 / 60} minutes`
|
||||
)
|
||||
|
||||
// 🚨 启动限流状态自动清理服务
|
||||
// 每5分钟检查一次过期的限流状态,确保账号能及时恢复调度
|
||||
const rateLimitCleanupService = require('./services/rateLimitCleanupService')
|
||||
const cleanupIntervalMinutes = config.system.rateLimitCleanupInterval || 5 // 默认5分钟
|
||||
rateLimitCleanupService.start(cleanupIntervalMinutes)
|
||||
logger.info(
|
||||
`🚨 Rate limit cleanup service started (checking every ${cleanupIntervalMinutes} minutes)`
|
||||
)
|
||||
}
|
||||
|
||||
setupGracefulShutdown() {
|
||||
@@ -554,6 +563,15 @@ class Application {
|
||||
} catch (error) {
|
||||
logger.error('❌ Error cleaning up pricing service:', error)
|
||||
}
|
||||
|
||||
// 停止限流清理服务
|
||||
try {
|
||||
const rateLimitCleanupService = require('./services/rateLimitCleanupService')
|
||||
rateLimitCleanupService.stop()
|
||||
logger.info('🚨 Rate limit cleanup service stopped')
|
||||
} catch (error) {
|
||||
logger.error('❌ Error stopping rate limit cleanup service:', error)
|
||||
}
|
||||
|
||||
try {
|
||||
await redis.disconnect()
|
||||
|
||||
Reference in New Issue
Block a user