mirror of
https://github.com/mii443/ncb-tts-r2.git
synced 2025-08-22 16:15:29 +00:00
refactor: Major overhaul with error handling, resilience patterns, and observability
- Add library configuration to support both lib and binary targets - Implement unified error handling with NCBError throughout the codebase - Add circuit breaker pattern for external API calls (Voicevox, GCP TTS) - Introduce comprehensive performance metrics and monitoring - Add cache persistence with disk storage support - Implement retry mechanism with exponential backoff - Add configuration file support (config.toml) with env var fallback - Enhance logging with structured tracing (debug, warn, error levels) - Add extensive unit tests for cache, metrics, and circuit breaker - Update base64 decoding to use modern API - Improve API error handling for Voicevox and GCP TTS clients Breaking changes: - Function signatures now return Result<T, NCBError> instead of panicking - Cache key structure modified with serialization support
This commit is contained in: