-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
clearfeat: Add configurable cache refresh system
Adds a cache refresh mechanism that runs before every command: - Add refresh_interval config option (in minutes) to control cache freshness - Add metadata tracking for cache refresh timestamps - Split cache storage into data (.cache) and metadata (.cache.meta) files Cache flow: 1. Every command loads existing cache data and metadata 2. If refresh_interval has elapsed: - For stats/reload: Synchronous refresh - For other commands: Async refresh (but command still uses existing cache data) 3. Command executes with loaded cache data Technical implementation: - Mutex-protected cache operations - Separate metadata file for tracking refresh timestamps - Support for excluded paths and patterns during refresh - Clean cache implementation for version upgrades Example config: refresh_interval: 60 # Minutes between cache refresh attempts Breaking changes: None Migration: No action needed, existing cache files remain compatible Note: The async refresh for non-stats commands doesnt provide immediate benefits as commands always use the existing cache data. Consider refactoring to use async refresh more effectively or removing the distinction between sync/async refresh.
- Loading branch information
1 parent
7e26f34
commit fe0390c
Showing
2 changed files
with
139 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters