mirror of
https://gitee.com/wanwujie/sub2api
synced 2026-04-22 15:44:46 +08:00
refactor: optimize project_id fill to lightweight approach
- Replace heavy RefreshAccountToken with lightweight tryFillProjectID (loadCodeAssist → onboardUser → fallback), consistent with Antigravity-Manager's behavior - Add sync.Map cooldown/dedup (60s) to prevent repeated fill attempts - Add fallback project_id "bamboo-precept-lgxtn" matching AM - Extract mergeCredentials helper to eliminate duplication - Use slog structured logging instead of log.Printf - Fix time.Sleep in OnboardUser to context-aware select - Fix strings.NewReader(string(bodyBytes)) → bytes.NewReader(bodyBytes) - Remove redundant tc := tc in test (Go 1.22+) - Add nil guard in persistProjectID for test safety
This commit is contained in:
@@ -51,7 +51,6 @@ func TestResolveDefaultTierID(t *testing.T) {
|
||||
}
|
||||
|
||||
for _, tc := range tests {
|
||||
tc := tc
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user