ensureCursorKey ensures the cursor map has capacity for the given key. Must be called with s.mu held.
(key string, limit int)
| 285 | // ensureCursorKey ensures the cursor map has capacity for the given key. |
| 286 | // Must be called with s.mu held. |
| 287 | func (s *RoundRobinSelector) ensureCursorKey(key string, limit int) { |
| 288 | if _, ok := s.cursors[key]; !ok && len(s.cursors) >= limit { |
| 289 | s.cursors = make(map[string]int) |
| 290 | } |
| 291 | } |
| 292 | |
| 293 | // Pick selects the first available auth for the provider in a deterministic manner. |
| 294 | func (s *FillFirstSelector) Pick(ctx context.Context, provider, model string, opts cliproxyexecutor.Options, auths []*Auth) (*Auth, error) { |