Add sync restriction on CacheStream

This commit is contained in:
Edward Shen 2021-07-16 01:13:01 -04:00
parent 54c8fe1cb3
commit b41ae8cb79
Signed by: edward
GPG key ID: 19182661E818369F
2 changed files with 2 additions and 2 deletions

2
src/cache/fs.rs vendored
View file

@ -65,7 +65,7 @@ pub(super) async fn read_file(
let parsed_metadata; let parsed_metadata;
let mut maybe_header = None; let mut maybe_header = None;
let mut reader: Option<Pin<Box<dyn MetadataFetch + Send>>> = None; let mut reader: Option<Pin<Box<dyn MetadataFetch + Send + Sync>>> = None;
if let Ok(metadata) = maybe_metadata { if let Ok(metadata) = maybe_metadata {
// image is decrypted // image is decrypted
if ENCRYPTION_KEY.get().is_some() { if ENCRYPTION_KEY.get().is_some() {

2
src/cache/mod.rs vendored
View file

@ -241,7 +241,7 @@ pub struct CacheEntry {
pub enum CacheStream { pub enum CacheStream {
Memory(MemStream), Memory(MemStream),
Completed(FramedRead<Pin<Box<dyn MetadataFetch + Send>>, BytesCodec>), Completed(FramedRead<Pin<Box<dyn MetadataFetch + Send + Sync>>, BytesCodec>),
} }
impl From<CachedImage> for CacheStream { impl From<CachedImage> for CacheStream {