aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src-tauri/src/core
diff options
context:
space:
mode:
authorBegonia, HE <163421589+BegoniaHe@users.noreply.github.com>2026-01-27 05:56:59 +0100
committerBegonia, HE <163421589+BegoniaHe@users.noreply.github.com>2026-01-29 03:03:59 +0100
commit68a493ef22cb0558a05dd3881c7d8cb4999d9679 (patch)
tree06d28e7c3b102943180e54c6f612f5e87a4b3ba3 /src-tauri/src/core
parentf4078c987a3899d4031acb49d72aa418432e046d (diff)
downloadDropOut-68a493ef22cb0558a05dd3881c7d8cb4999d9679.tar.gz
DropOut-68a493ef22cb0558a05dd3881c7d8cb4999d9679.zip
feat(java): implement cache versioning, size limits, and automatic cleanup
- Add CACHE_VERSION constant for cache format compatibility tracking - Add MAX_CACHE_SIZE_BYTES limit (10 MB) to prevent unbounded cache growth - Add cache_version field to JavaCatalog struct with default value - Implement cache version validation in load_cached_catalog() - Implement cache size enforcement in save_catalog_cache() - Add cleanup_expired_caches() for background cache cleanup - Add enforce_cache_size_limit() to validate cache file sizes - Add is_cache_version_compatible() helper function - Automatically clean up expired caches on load and clear operations - Validate cache version before using cached data Fixes: - Cache expiration without automatic cleanup (now cleaned on load) - Missing cache version control (now validates format compatibility) - Unbounded cache size growth (now limited to 10 MB) Reviewed-by: Claude 3.5 Sonnet
Diffstat (limited to 'src-tauri/src/core')
-rw-r--r--src-tauri/src/core/java/providers/adoptium.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/src-tauri/src/core/java/providers/adoptium.rs b/src-tauri/src/core/java/providers/adoptium.rs
index 13ef2a5..4b06721 100644
--- a/src-tauri/src/core/java/providers/adoptium.rs
+++ b/src-tauri/src/core/java/providers/adoptium.rs
@@ -198,6 +198,7 @@ impl JavaProvider for AdoptiumProvider {
available_major_versions: available.available_releases,
lts_versions: available.available_lts_releases,
cached_at: now,
+ cache_version: 1,
};
let _ = super::super::save_catalog_cache(app_handle, &catalog);