Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: (core) Add circuit breaker pattern for database operations
Implements circuit breaker pattern to handle database failures gracefully and prevent cascading failures. Fixes elizaOS#712. Changes: - Adds CircuitBreaker class with CLOSED, OPEN, and HALF-OPEN states - Introduces BaseCircuitBreakerAdapter for database adapters - Configurable failure thresholds and recovery timeouts - Automatic recovery attempts in HALF-OPEN state - Detailed logging of circuit breaker state changes Circuit breaker configuration: - Opens after 5 consecutive failures (configurable) - Resets after 60 seconds in OPEN state - Requires 3 successful operations in HALF-OPEN state to close This helps prevent overwhelming failed database connections and provides graceful degradation during outages.
- Loading branch information