Članci s tagom #failover
-
Circuit breaker for AI providers in PHP: OPEN/HALF_OPEN/CLOSED state machine
CircuitBreaker: CLOSED/OPEN/HALF_OPEN state machine, failureThreshold=3, transientRecoverySeconds=300 (5min), permanentRecoverySeconds=1800 (30min), DB-backed ai_provider_health (one indexed PK read/request). ProviderError: 6 categories — PERMANENT_BILLING vs RATE_LIMITED distinction (413 is TPM cap not billing, URL-stripped match, billing before 4xx/401 check). Retry-After honored. upsert avoids deprecated ON DUPLICATE KEY UPDATE.
-
Multi-provider AI with automatic failover: how TaskRouter works in PHP
TaskRouter: 10 named task roles, failover chains (paid → FREE on failure), a stateful circuit breaker in ai_provider_health, 6 provider adapters, and zero vendor lock-in in application code. Every AI call is one method; the router handles the rest.