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

Method publishAIProvidersChanged

coderd/ai_providers.go:483–490  ·  view source on GitHub ↗

publishAIProvidersChanged notifies subscribers (aibridged, aibridgeproxyd) that the live provider set changed and they should refetch from the database. Pubsub failures are logged but not propagated: subscribers refresh authoritatively from the DB, so a dropped notification only delays convergence.

(ctx context.Context)

Source from the content-addressed store, hash-verified

481// propagated: subscribers refresh authoritatively from the DB, so a
482// dropped notification only delays convergence.
483func (api *API) publishAIProvidersChanged(ctx context.Context) {
484 if api.Pubsub == nil {
485 return
486 }
487 if err := api.Pubsub.Publish(coderpubsub.AIProvidersChangedChannel, nil); err != nil {
488 api.Logger.Warn(ctx, "publish ai providers changed event", slog.Error(err))
489 }
490}
491
492// errBedrockRejectsAPIKeys is the sentinel returned from inside the
493// update transaction when a caller attempts to attach api_keys to a

Callers 3

aiProvidersCreateMethod · 0.95
aiProvidersUpdateMethod · 0.95
aiProvidersDeleteMethod · 0.95

Calls 2

PublishMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected