Skip to content

Commit 34695ac

Browse files
QTomclaude
andcommitted
fix: 移除账号导入时同步调用 disableOpenAITraining,避免网络超时导致导入失败
privacy_mode 改为由 TokenRefreshService 在 token 刷新后异步补设。 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent a63de12 commit 34695ac

1 file changed

Lines changed: 1 addition & 18 deletions

File tree

backend/internal/service/admin_service.go

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1425,30 +1425,13 @@ func (s *adminServiceImpl) CreateAccount(ctx context.Context, input *CreateAccou
14251425
}
14261426
}
14271427

1428-
// OpenAI OAuth: attempt to disable training data sharing
1429-
extra := input.Extra
1430-
if input.Platform == PlatformOpenAI && input.Type == AccountTypeOAuth {
1431-
if token, _ := input.Credentials["access_token"].(string); token != "" {
1432-
var proxyURL string
1433-
if input.ProxyID != nil {
1434-
if p, err := s.proxyRepo.GetByID(ctx, *input.ProxyID); err == nil && p != nil {
1435-
proxyURL = p.URL()
1436-
}
1437-
}
1438-
if extra == nil {
1439-
extra = make(map[string]any)
1440-
}
1441-
extra["privacy_mode"] = disableOpenAITraining(ctx, s.privacyClientFactory, token, proxyURL)
1442-
}
1443-
}
1444-
14451428
account := &Account{
14461429
Name: input.Name,
14471430
Notes: normalizeAccountNotes(input.Notes),
14481431
Platform: input.Platform,
14491432
Type: input.Type,
14501433
Credentials: input.Credentials,
1451-
Extra: extra,
1434+
Extra: input.Extra,
14521435
ProxyID: input.ProxyID,
14531436
Concurrency: input.Concurrency,
14541437
Priority: input.Priority,

0 commit comments

Comments
 (0)