diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-02-22 21:33:37 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-02-22 21:33:37 +0900 |
| commit | 0496eccfb25e53c3f4cd3869b2f7bcc111927dcb (patch) | |
| tree | 17e89dd8dd3d9f406853c31d41b7405926d842c4 /crates/mozart/src/commands/clear_cache.rs | |
| parent | fae4ee64a48623724eb3dd63deba4dc0184b582e (diff) | |
| download | php-mozart-0496eccfb25e53c3f4cd3869b2f7bcc111927dcb.tar.gz php-mozart-0496eccfb25e53c3f4cd3869b2f7bcc111927dcb.tar.zst php-mozart-0496eccfb25e53c3f4cd3869b2f7bcc111927dcb.zip | |
fix(clear-cache): enforce 1 GB repo cache size limit during GC
Composer caps the repo cache at 1 GB during garbage collection, but
Mozart was passing u64::MAX (no limit). Align with Composer behavior.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat (limited to 'crates/mozart/src/commands/clear_cache.rs')
| -rw-r--r-- | crates/mozart/src/commands/clear_cache.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/crates/mozart/src/commands/clear_cache.rs b/crates/mozart/src/commands/clear_cache.rs index e0ae111..7bca623 100644 --- a/crates/mozart/src/commands/clear_cache.rs +++ b/crates/mozart/src/commands/clear_cache.rs @@ -20,7 +20,8 @@ pub async fn execute( let repo_cache = Cache::repo(&config); let files_cache = Cache::files(&config); - repo_cache.gc(config.cache_ttl, u64::MAX)?; + // Composer enforces a 1 GB cap on the repo cache during GC + repo_cache.gc(config.cache_ttl, 1024 * 1024 * 1024)?; files_cache.gc(config.cache_files_ttl, config.cache_files_maxsize)?; console.info("Cache garbage collection complete."); |
