Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: improve cache storage #8675

Merged
merged 5 commits into from
Dec 12, 2024
Merged

feat: improve cache storage #8675

merged 5 commits into from
Dec 12, 2024

Conversation

LingyuCoder
Copy link
Contributor

@LingyuCoder LingyuCoder commented Dec 11, 2024

Summary

  • Add version to storage path.
  • Validate expiration for the whole storage, not only one scope.
  • Clean expired versions and unused scopes.

Generate by copilot

This pull request introduces several changes to improve the functionality and structure of the rspack_storage module. The main changes include the addition of RootMeta and RootOptions structures, updates to the ScopeManager to handle root metadata, and various modifications to ensure proper functionality and testing.

Key Changes:

Enhancements to Metadata Management:

  • Added RootMeta and RootOptions structures to manage root metadata and configuration. (crates/rspack_storage/src/pack/data/meta.rs, crates/rspack_storage/src/pack/data/options.rs, crates/rspack_storage/src/pack/manager/mod.rs) [1] [2] [3]

Updates to ScopeManager:

  • Modified ScopeManager to include root_meta and root_options, and updated methods to handle root metadata. (crates/rspack_storage/src/pack/manager/mod.rs) [1] [2]
  • Implemented logic to validate and load scopes based on root metadata. (crates/rspack_storage/src/pack/manager/mod.rs) [1] [2]

Code Cleanup and Refactoring:

  • Removed the expire field from PackOptions and moved related logic to RootOptions. (crates/rspack_storage/src/pack/data/options.rs)
  • Renamed metadata files from cache_meta to scope_meta for better clarity. (crates/rspack_storage/src/pack/data/meta.rs, crates/rspack_storage/src/pack/manager/mod.rs) [1] [2]

Test Adjustments:

  • Updated tests to align with the new RootOptions and scope_meta changes. (crates/rspack_storage/src/pack/manager/mod.rs) [1] [2]

These changes enhance the management of metadata, improve the structure of the code, and ensure that the system can handle root-level configurations and validations effectively.

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

@github-actions github-actions bot added team The issue/pr is created by the member of Rspack. release: feature release: feature related release(mr only) labels Dec 11, 2024
Copy link

netlify bot commented Dec 11, 2024

Deploy Preview for rspack canceled.

Name Link
🔨 Latest commit 60d6d37
🔍 Latest deploy log https://app.netlify.com/sites/rspack/deploys/675a9d7fda8c910008e596de

@LingyuCoder LingyuCoder changed the title feat: cache storage version feat: improve cache storage Dec 12, 2024
@LingyuCoder LingyuCoder merged commit 15d948e into main Dec 12, 2024
36 checks passed
@LingyuCoder LingyuCoder deleted the feat/cache-storage-version branch December 12, 2024 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release: feature release: feature related release(mr only) team The issue/pr is created by the member of Rspack.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants