MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / Load

Method Load

sdk/cliproxy/auth/conductor.go:2240–2267  ·  view source on GitHub ↗

Load resets manager state from the backing store.

(ctx context.Context)

Source from the content-addressed store, hash-verified

2238
2239// Load resets manager state from the backing store.
2240func (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.

Callers

nothing calls this directly

Calls 6

syncSchedulerMethod · 0.95
EnsureIndexMethod · 0.80
ListMethod · 0.65
LoadMethod · 0.65
CloneMethod · 0.45

Tested by

no test coverage detected