Closed adzialocha closed 1 year ago
Observing some weird race-conditions (locally and in CI) where files do not exist yet when running fs
methods. After changing this to tokio::fs
(making it async) it became more stable .. I'm not exactly sure but tokio seems to bring different guarantees with its methods.
By the way, this is an interesting method I've stumbled upon: https://docs.rs/tokio/latest/tokio/fs/struct.File.html#method.sync_data - don't think we need it (we're fine with the OS managing files however it wants, as long as we can read from them), just good to keep in mind that file systems are weird.
Patch coverage: 93.84%
and project coverage change: +0.08%
:tada:
Comparison is base (
6c5d477
) 92.42% compared to head (edc0b30
) 92.50%.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
This PR switches from using symlinks and the
ServeDir
struct fromtower
to HTTP routes which resolve the blobs manually and respond with the correct content types.Notable changes:
/blobs
folder, without sub-directories using their document view id/blobs/:documentId
respond with the latest blob/blobs/:documentId/:viewId
respond with the blob at that view id (this makes/blobs/documents/...
obsoleteContent-Type
header set by the blob's self-declared MIME typeETag
headerIf-None-Match
header might be responded with a 304 "Not Modified" in case the entity tags matchedupdate_blob
test methodadd_blob
test method to slice up blob data into "pieces" by given "max piece length" variablefs
methods to asynctokio::fs
Closes #541 and #501
📋 Checklist
CHANGELOG.md