Load resets manager state from the backing store.
(ctx context.Context)
| 2238 | |
| 2239 | // Load resets manager state from the backing store. |
| 2240 | func (m *Manager) Load(ctx context.Context) error { |
| 2241 | m.mu.Lock() |
| 2242 | if m.store == nil { |
| 2243 | m.mu.Unlock() |
| 2244 | return nil |
| 2245 | } |
| 2246 | items, err := m.store.List(ctx) |
| 2247 | if err != nil { |
| 2248 | m.mu.Unlock() |
| 2249 | return err |
| 2250 | } |
| 2251 | m.auths = make(map[string]*Auth, len(items)) |
| 2252 | for _, auth := range items { |
| 2253 | if auth == nil || auth.ID == "" { |
| 2254 | continue |
| 2255 | } |
| 2256 | auth.EnsureIndex() |
| 2257 | m.auths[auth.ID] = auth.Clone() |
| 2258 | } |
| 2259 | cfg, _ := m.runtimeConfig.Load().(*internalconfig.Config) |
| 2260 | if cfg == nil { |
| 2261 | cfg = &internalconfig.Config{} |
| 2262 | } |
| 2263 | m.rebuildAPIKeyModelAliasLocked(cfg) |
| 2264 | m.mu.Unlock() |
| 2265 | m.syncScheduler() |
| 2266 | return nil |
| 2267 | } |
| 2268 | |
| 2269 | // Execute performs a non-streaming execution using the configured selector and executor. |
| 2270 | // It supports multiple providers for the same model and round-robins the starting provider per model. |
nothing calls this directly
no test coverage detected