Skip to content

feat(base): Add automatic media cache cleanups to MediaService#4603

Merged
Hywan merged 11 commits intomatrix-org:mainfrom
zecakeh:media-cache-auto-cleanup
Feb 5, 2025
Merged

feat(base): Add automatic media cache cleanups to MediaService#4603
Hywan merged 11 commits intomatrix-org:mainfrom
zecakeh:media-cache-auto-cleanup

Conversation

@zecakeh
Copy link
Copy Markdown
Collaborator

@zecakeh zecakeh commented Feb 2, 2025

Follow up to #4571, this time we offer to run periodic automatic cleanups. This requires a few more bounds on the types to be able to send them into a new task.

This can be reviewed commit by commit.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
…y (de)serializing them

Since it's a common occurrence, it will reduce duplication.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
We want to be able to send it to a new task, so the easiest way is to be able to clone it.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
…nt Clone

We want to be able to send the store to a new task, so the easiest way is to be able to clone it.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
For parity with tokio's JoinHandle.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
@zecakeh zecakeh requested a review from a team as a code owner February 2, 2025 11:25
@zecakeh zecakeh requested review from Hywan and removed request for a team February 2, 2025 11:25
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 2, 2025

Codecov Report

Attention: Patch coverage is 94.59459% with 6 lines in your changes missing coverage. Please review.

Project coverage is 85.72%. Comparing base (8a76587) to head (ed18c51).
Report is 12 commits behind head on main.

Files with missing lines Patch % Lines
...-base/src/event_cache/store/media/media_service.rs 92.98% 4 Missing ⚠️
crates/matrix-sdk-common/src/executor.rs 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4603      +/-   ##
==========================================
+ Coverage   85.70%   85.72%   +0.01%     
==========================================
  Files         292      292              
  Lines       33406    33487      +81     
==========================================
+ Hits        28632    28708      +76     
- Misses       4774     4779       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Copy Markdown
Member

@Hywan Hywan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, I had a couple of feedback but they were all addressed by the original code. Nothing to say other than: well done! I'm excited to see this!

@Hywan
Copy link
Copy Markdown
Member

Hywan commented Feb 4, 2025

Can you please resolve the conflict to unblock the merge please?

@zecakeh
Copy link
Copy Markdown
Collaborator Author

zecakeh commented Feb 4, 2025

Done.

@Hywan Hywan merged commit 954b16a into matrix-org:main Feb 5, 2025
@Hywan
Copy link
Copy Markdown
Member

Hywan commented Feb 5, 2025

Thanks, you rocks 🤘

@zecakeh zecakeh deleted the media-cache-auto-cleanup branch February 5, 2025 12:25
yostyle pushed a commit to tchapgouv/matrix-rust-sdk that referenced this pull request Apr 4, 2025
feat(base): Add automatic media cache cleanups to MediaService
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants