diff --git a/internal/cache/disk_cache.go b/internal/cache/disk_cache.go index 380b6b4..0f6c2ab 100644 --- a/internal/cache/disk_cache.go +++ b/internal/cache/disk_cache.go @@ -134,7 +134,7 @@ func (dc *DiskCache) lazyLoad() { defer close(dc.loadCh) // 扫描目录加载元数据(不加载实际数据) - filepath.Walk(dc.basePath, func(path string, info os.FileInfo, err error) error { + _ = filepath.Walk(dc.basePath, func(path string, info os.FileInfo, err error) error { if err != nil || info.IsDir() { return nil } @@ -214,7 +214,7 @@ func (dc *DiskCache) Get(hashKey uint64, origKey string) (*ProxyCacheEntry, bool if meta.CRC32 != 0 { if crc32.ChecksumIEEE(data) != meta.CRC32 { // 数据损坏,删除条目 - dc.Delete(hashKey) + _ = dc.Delete(hashKey) dc.missCount.Add(1) return nil, false, false } diff --git a/internal/cache/tiered_cache.go b/internal/cache/tiered_cache.go index cdb6d99..ee2cfa2 100644 --- a/internal/cache/tiered_cache.go +++ b/internal/cache/tiered_cache.go @@ -134,7 +134,7 @@ func (tc *TieredCache) Set(hashKey uint64, origKey string, data []byte, headers // Delete 删除缓存条目(实现 CacheBackend 接口)。 func (tc *TieredCache) Delete(hashKey uint64) error { - tc.l1.Delete(hashKey) + _ = tc.l1.Delete(hashKey) return tc.l2.Delete(hashKey) } @@ -238,15 +238,3 @@ func (tc *TieredCache) checkAndPromote() { } } } - -// revalidate 重新验证过期缓存。 -func (tc *TieredCache) revalidate(hashKey uint64, origKey string, entry *ProxyCacheEntry) { - // 标记为正在更新 - entry.Updating.Store(true) - - // 删除 L1 中的过期条目(如果存在) - tc.l1.Delete(hashKey) - - // 注意:实际的重新验证逻辑需要在 proxy 层实现 - // 这里只是标记和清理,真正的重新获取由 proxy 层触发 -} diff --git a/internal/config/config.go b/internal/config/config.go index f56ed75..10977ff 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -455,7 +455,7 @@ func parseSize(s string) (int, error) { // 提取单位 unit := strings.ToLower(s[len(s)-1:]) - var multiplier int = 1 + multiplier := 1 numStr := s if unit == "k" {