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

Fix: use per request cache on tus metadata #422

Merged
merged 1 commit into from
Jan 22, 2024
Merged

Conversation

fenos
Copy link
Contributor

@fenos fenos commented Jan 17, 2024

What kind of change does this PR introduce?

Bug fix

What is the current behavior?

The metadata cache is stored in Map in memory.
When running multiple instances creates issues as it never gets invalidated

What is the new behavior?

Introducing a RequestCacheMetadata which is scoped to a single request.
This reduces the calls to fetch the metadata to 1 call per request instead of 8 per request.

@coveralls
Copy link

coveralls commented Jan 17, 2024

Pull Request Test Coverage Report for Build 7583015849

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.2%) to 82.976%

Totals Coverage Status
Change from base Build 7552611398: 0.2%
Covered Lines: 7882
Relevant Lines: 9393

💛 - Coveralls

@fenos
Copy link
Contributor Author

fenos commented Jan 17, 2024

Will wait for:

to remove the ported s3Store (to have the workaround for the S3 cache), and use the S3Store from the @tus/s3-store package.

Additionally, we can also remove the Metadata.parse call present on the namingFunction since it will be now be part of the @tus/server api 🎉

@fenos fenos force-pushed the tus/dont-cache-metadata branch from 590b9ac to beb2836 Compare January 18, 2024 15:52
@fenos fenos force-pushed the tus/dont-cache-metadata branch from beb2836 to 56cec76 Compare January 19, 2024 11:13
@fenos fenos merged commit 652f8ec into master Jan 22, 2024
1 check passed
@fenos fenos deleted the tus/dont-cache-metadata branch January 22, 2024 10:47
Copy link

🎉 This PR is included in version 0.46.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants