fix(admin): gate scheduler score calculation

This commit is contained in:
jjaw
2026-07-08 06:58:35 +08:00
parent e8e234252a
commit 6ae5fc31b3
6 changed files with 111 additions and 6 deletions
@@ -16,6 +16,8 @@ type stubAdminService struct {
accounts []service.Account
accountSchedulerScoreFilterAccounts []service.Account
openAISchedulerScorePoolAccounts []service.Account
schedulerScoreFilterCalls int
openAISchedulerScorePoolCalls int
proxies []service.Proxy
proxyCounts []service.ProxyWithAccountCount
redeems []service.RedeemCode
@@ -351,6 +353,7 @@ func (s *stubAdminService) ListAccounts(ctx context.Context, page, pageSize int,
}
func (s *stubAdminService) ListAccountsForSchedulerScoreFilter(_ context.Context, platform, accountType, status, search string, groupID int64, privacyMode string) ([]service.Account, error) {
s.schedulerScoreFilterCalls++
if s.accountSchedulerScoreFilterAccounts != nil {
return s.accountSchedulerScoreFilterAccounts, nil
}
@@ -358,6 +361,7 @@ func (s *stubAdminService) ListAccountsForSchedulerScoreFilter(_ context.Context
}
func (s *stubAdminService) ListOpenAISchedulableAccountsForSchedulerScore(_ context.Context, groupID *int64) ([]service.Account, error) {
s.openAISchedulerScorePoolCalls++
accounts := s.openAISchedulerScorePoolAccounts
if accounts == nil {
accounts = s.accounts