fix: 修复批量更新凭证明细与缓存TTL抖动

- BatchUpdateCredentials 返回 success/failed/results 及 success_ids/failed_ids

- billing jitteredTTL 改为只减不增,确保TTL不超上界

- crypto/rand 失败时随机ID降级避免 panic

- OpenAI SelectAccount 失败日志去重并补充字段

- 修复两处类型断言以通过 errcheck
This commit is contained in:
yangjianbo
2026-02-07 21:18:03 +08:00
parent bc3ca5f068
commit 4a20a2a8ba
6 changed files with 61 additions and 18 deletions

View File

@@ -483,7 +483,11 @@ func (s *SubscriptionService) GetActiveSubscription(ctx context.Context, userID,
return nil, err
}
// singleflight 返回的也是缓存指针,需要浅拷贝
cp := *value.(*UserSubscription)
sub, ok := value.(*UserSubscription)
if !ok || sub == nil {
return nil, ErrSubscriptionNotFound
}
cp := *sub
return &cp, nil
}