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

Function circuitBreakerConfig

cli/aibridged.go:351–361  ·  view source on GitHub ↗

circuitBreakerConfig returns nil when the breaker is disabled.

(cfg codersdk.AIBridgeConfig)

Source from the content-addressed store, hash-verified

349
350// circuitBreakerConfig returns nil when the breaker is disabled.
351func circuitBreakerConfig(cfg codersdk.AIBridgeConfig) *config.CircuitBreaker {
352 if !cfg.CircuitBreakerEnabled.Value() {
353 return nil
354 }
355 return &config.CircuitBreaker{
356 FailureThreshold: uint32(cfg.CircuitBreakerFailureThreshold.Value()), //nolint:gosec // Validated by serpent.Validate in deployment options.
357 Interval: cfg.CircuitBreakerInterval.Value(),
358 Timeout: cfg.CircuitBreakerTimeout.Value(),
359 MaxRequests: uint32(cfg.CircuitBreakerMaxRequests.Value()), //nolint:gosec // Validated by serpent.Validate in deployment options.
360 }
361}

Callers 1

buildAIProviderFromRowFunction · 0.85

Calls 1

ValueMethod · 0.45

Tested by

no test coverage detected