mirror of
https://github.com/rustic-rs/rustic.git
synced 2025-10-26 11:18:51 +00:00
commit
d415ebec00
@ -67,7 +67,9 @@ impl<BE: WriteBackend> ReadBackend for CachedBackend<BE> {
|
||||
) -> Result<Vec<u8>> {
|
||||
match (&self.cache, cacheable || tpe.is_cacheable()) {
|
||||
(None, _) | (Some(_), false) => {
|
||||
self.be.read_partial(tpe, id, false, offset, length).await
|
||||
self.be
|
||||
.read_partial(tpe, id, cacheable, offset, length)
|
||||
.await
|
||||
}
|
||||
(Some(cache), true) => match cache.read_partial(tpe, id, offset, length).await {
|
||||
Ok(res) => Ok(res),
|
||||
|
||||
@ -56,8 +56,8 @@ impl FileType {
|
||||
|
||||
pub fn is_cacheable(&self) -> bool {
|
||||
match self {
|
||||
FileType::Config | FileType::Key => false,
|
||||
FileType::Snapshot | FileType::Index | FileType::Pack => true,
|
||||
FileType::Config | FileType::Key | FileType::Pack => false,
|
||||
FileType::Snapshot | FileType::Index => true,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user