Skip to content

feat: 基于总大小的 LRU 缓存清理(REPO_CACHE_MAX_SIZE_GB) #12

Description

@lishuceo

背景

config.repoCache.maxSizeGb 配置项已定义(标了 TODO),但 cleanupExpiredCaches 只实现了基于时间的过期清理,没有基于总大小的 LRU 淘汰。

需求

  • 遍历缓存目录计算总大小
  • 超过 REPO_CACHE_MAX_SIZE_GB 时,按最近修改时间(mtimeMs)从旧到新淘汰
  • 移除 config.ts 中的 TODO 注释

参考

src/config.ts:44src/workspace/cache.ts cleanupExpiredCaches

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions