MCPcopy Index your code
hub / github.com/coder/coder / Reload

Method Reload

cli/aibridged.go:91–103  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

89}
90
91func (r *poolDBReloader) Reload(ctx context.Context) error {
92 r.metrics.RecordReloadAttempt()
93 providers, outcomes, err := BuildProviders(ctx, r.db, r.cfg, r.logger)
94 if err != nil {
95 // Keep the previous snapshot in place: dropping all providers
96 // because the DB read failed would compound the visible failure
97 // mode beyond the operator's actual misconfiguration.
98 return xerrors.Errorf("load ai providers from database: %w", err)
99 }
100 r.pool.ReplaceProviders(providers)
101 r.metrics.RecordReloadSuccess(outcomes)
102 return nil
103}
104
105// BuildProviders loads all ai_providers rows (enabled and disabled),
106// attaches keys to enabled rows, and constructs the equivalent

Callers

nothing calls this directly

Calls 5

BuildProvidersFunction · 0.85
RecordReloadAttemptMethod · 0.80
RecordReloadSuccessMethod · 0.80
ReplaceProvidersMethod · 0.65
ErrorfMethod · 0.45

Tested by

no test coverage detected