29 lines
904 B
Go
29 lines
904 B
Go
package textgen
|
|
|
|
import (
|
|
"time"
|
|
|
|
"git.threesix.ai/jordan/persona-community-5/pkg/routing"
|
|
)
|
|
|
|
// CircuitBreaker is an alias for routing.CircuitBreaker.
|
|
//
|
|
// IMPORTANT: All cooldown tracking logic is implemented in pkg/routing.
|
|
// Do NOT implement custom cooldown logic here. Use routing.CircuitBreaker
|
|
// directly for new code.
|
|
type CircuitBreaker = routing.CircuitBreaker
|
|
|
|
// Cooldown period constants - re-exported from routing for convenience.
|
|
const (
|
|
// DefaultCooldownPeriod is the cooldown for rate limits and quota errors.
|
|
DefaultCooldownPeriod = routing.DefaultCooldownPeriod
|
|
|
|
// TransientCooldownPeriod is the cooldown for transient server errors (503, 500, etc).
|
|
TransientCooldownPeriod = routing.TransientCooldownPeriod
|
|
)
|
|
|
|
// NewCircuitBreaker creates a new circuit breaker.
|
|
func NewCircuitBreaker(cooldown time.Duration) *CircuitBreaker {
|
|
return routing.NewCircuitBreaker(cooldown)
|
|
}
|