Repository navigation
🚀 The Quick Reviewer 3.1.0 Released
feat: Introduces Persistent Database Caching and Graceful Shutdown
Description:
This release merges significant architectural upgrades from the devel branch into main. The primary change is the introduction of a persistent storage layer, moving from a volatile in-memory cache to a robust database-backed system. This ensures that generated reviews persist across application restarts, reducing redundant API calls and improving long-term performance.
Additionally, this update introduces proper server lifecycle management, including graceful shutdown and periodic cache cleanup, to enhance the addon's stability and reliability.
✨ Features
-
Persistent Caching Layer (
/src/core/storage.js)- A new unified storage module has been added to replace the previous in-memory cache.
- SQLite & PostgreSQL Support: The addon can now use SQLite or PostgreSQL for caching by setting a
DATABASE_URIenvironment variable. This allows reviews to persist permanently. - Graceful Fallback: If
DATABASE_URIis not provided or fails to connect, the system automatically falls back to the original in-memory caching behavior without interrupting service.
-
Enhanced Server Reliability (
/server.js)- Graceful Shutdown: The server now correctly handles
SIGTERMandSIGINTsignals to close database connections and shut down cleanly. - Periodic Cleanup: A background job now runs every 6 hours to automatically clean up expired review entries from the cache or database.
- Process Management: Added handlers for
uncaughtExceptionandunhandledRejectionto improve server stability.
- Graceful Shutdown: The server now correctly handles
🐛 Bug Fixes & Improvements
- Corrected Stream URL: Fixed a bug in
/src/core/stremioStreamer.jswhere URL query parameters in the review link were incorrectly separated by&instead of&, which could cause issues in some clients. - Updated Docker Image: The
Dockerfilehas been switched fromnode:24-alpinetonode:24-slim(Debian) to ensure compatibility with native dependencies required bybetter-sqlite3. - Asynchronous API Endpoints: The API routes that interact with the cache (
/api/cached-reviews) are now asynchronous to properly support database operations. - New Dependencies: Added
better-sqlite3andpgtopackage.jsonto support the new database backends.