bugfix/thumbnails on update
Bug 1 & 2 (webdav_handler.rs handle_put() update branch):
- After a successful file update via WebDAV PUT, if the content type is a supported image:
a. delete_thumbnails(file_id) — evicts the stale moka cache entry
b. Spawns a background task to read the new blob bytes and call generate_all_sizes_background_from_bytes
Bug 3 & 4 (dedup_service.rs):
- Added thumbnail_service: Option<Arc<ThumbnailService>> field with a with_thumbnail_service() builder
- In remove_legacy_reference(): calls delete_blob_thumbnails(hash) when ref_count hits 0
- In remove_manifest_reference(): calls delete_blob_thumbnails(file_hash) when manifest's last ref is dropped
- Wired in di.rs — the thumbnail service is created before dedup service so the ordering works cleanly
This commit is contained in:
@@ -972,6 +972,15 @@ async fn handle_put(
|
||||
);
|
||||
}
|
||||
|
||||
state
|
||||
.core
|
||||
.refresh_thumbnails_after_update(
|
||||
file_dto.id.clone(),
|
||||
file_dto.etag.clone(),
|
||||
&content_type,
|
||||
)
|
||||
.await;
|
||||
|
||||
Ok(Response::builder()
|
||||
.status(StatusCode::NO_CONTENT)
|
||||
.body(Body::empty())
|
||||
|
||||
Reference in New Issue
Block a user