mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-02-11 02:33:51 +08:00
feat(storage): implement storage manager for centralized management and cleanup
- Added a new Storage Manager component to handle storage statistics, project cleanup, and configuration for CCW centralized storage. - Introduced functions to calculate directory sizes, get project storage stats, and clean specific or all storage. - Enhanced SQLiteStore with a public API for executing queries securely. - Updated tests to utilize the new execute_query method and validate storage management functionalities. - Improved performance by implementing connection pooling with idle timeout management in SQLiteStore. - Added new fields (token_count, symbol_type) to the symbols table and adjusted related insertions. - Enhanced error handling and logging for storage operations.
This commit is contained in:
@@ -29,8 +29,11 @@ export class CacheManager<T> {
|
||||
* @param options - Cache configuration options
|
||||
*/
|
||||
constructor(cacheKey: string, options: CacheOptions = {}) {
|
||||
if (!options.cacheDir) {
|
||||
throw new Error('CacheManager requires cacheDir option. Use StoragePaths.project(path).cache');
|
||||
}
|
||||
this.ttl = options.ttl || 5 * 60 * 1000; // Default: 5 minutes
|
||||
this.cacheDir = options.cacheDir || '.ccw-cache';
|
||||
this.cacheDir = options.cacheDir;
|
||||
this.cacheFile = join(this.cacheDir, `${cacheKey}.json`);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user