mirror of
https://github.com/Wei-Shaw/claude-relay-service.git
synced 2026-01-23 00:53:33 +00:00
format
This commit is contained in:
@@ -237,25 +237,25 @@ class UnifiedClaudeScheduler {
|
|||||||
)
|
)
|
||||||
await this._deleteSessionMapping(sessionHash)
|
await this._deleteSessionMapping(sessionHash)
|
||||||
} else {
|
} else {
|
||||||
// 验证映射的账户是否仍然可用
|
// 验证映射的账户是否仍然可用
|
||||||
const isAvailable = await this._isAccountAvailable(
|
const isAvailable = await this._isAccountAvailable(
|
||||||
mappedAccount.accountId,
|
mappedAccount.accountId,
|
||||||
mappedAccount.accountType,
|
mappedAccount.accountType,
|
||||||
effectiveModel
|
effectiveModel
|
||||||
)
|
|
||||||
if (isAvailable) {
|
|
||||||
// 🚀 智能会话续期:剩余时间少于14天时自动续期到15天
|
|
||||||
await redis.extendSessionAccountMappingTTL(sessionHash)
|
|
||||||
logger.info(
|
|
||||||
`🎯 Using sticky session account: ${mappedAccount.accountId} (${mappedAccount.accountType}) for session ${sessionHash}`
|
|
||||||
)
|
)
|
||||||
return mappedAccount
|
if (isAvailable) {
|
||||||
} else {
|
// 🚀 智能会话续期:剩余时间少于14天时自动续期到15天
|
||||||
logger.warn(
|
await redis.extendSessionAccountMappingTTL(sessionHash)
|
||||||
`⚠️ Mapped account ${mappedAccount.accountId} is no longer available, selecting new account`
|
logger.info(
|
||||||
)
|
`🎯 Using sticky session account: ${mappedAccount.accountId} (${mappedAccount.accountType}) for session ${sessionHash}`
|
||||||
await this._deleteSessionMapping(sessionHash)
|
)
|
||||||
}
|
return mappedAccount
|
||||||
|
} else {
|
||||||
|
logger.warn(
|
||||||
|
`⚠️ Mapped account ${mappedAccount.accountId} is no longer available, selecting new account`
|
||||||
|
)
|
||||||
|
await this._deleteSessionMapping(sessionHash)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user