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)
| 481 | // propagated: subscribers refresh authoritatively from the DB, so a |
| 482 | // dropped notification only delays convergence. |
| 483 | func (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 |
no test coverage detected