This commit is contained in:
SunSeekerX
2026-01-04 12:05:53 +08:00
parent 90023d1551
commit f5e982632d
28 changed files with 481 additions and 213 deletions

View File

@@ -2,7 +2,12 @@ const droidAccountService = require('./droidAccountService')
const accountGroupService = require('./accountGroupService')
const redis = require('../models/redis')
const logger = require('../utils/logger')
const { isTruthy, isAccountHealthy, sortAccountsByPriority, normalizeEndpointType } = require('../utils/commonHelper')
const {
isTruthy,
isAccountHealthy,
sortAccountsByPriority,
normalizeEndpointType
} = require('../utils/commonHelper')
class DroidScheduler {
constructor() {
@@ -16,8 +21,12 @@ class DroidScheduler {
_matchesEndpoint(account, endpointType) {
const normalizedEndpoint = normalizeEndpointType(endpointType)
const accountEndpoint = normalizeEndpointType(account?.endpointType)
if (normalizedEndpoint === accountEndpoint) return true
if (normalizedEndpoint === 'comm') return true
if (normalizedEndpoint === accountEndpoint) {
return true
}
if (normalizedEndpoint === 'comm') {
return true
}
const sharedEndpoints = new Set(['anthropic', 'openai'])
return sharedEndpoints.has(normalizedEndpoint) && sharedEndpoints.has(accountEndpoint)
}