Skip to content

Commit

Permalink
Fix #2
Browse files Browse the repository at this point in the history
  • Loading branch information
de-sh committed May 7, 2021
1 parent 186540b commit b49ab40
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/local.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ impl Local {

/// Insert VALUEs onto Global in either a single packet or as a stream as per it's size
pub async fn insert(&mut self, key: Bytes, value: Bytes) -> Result<(), Box<dyn Error>> {
if value.len() > MAX_BYTE_SIZE {
if value.len() < MAX_BYTE_SIZE {
self.insert_single(key, value).await
} else {
self.insert_file(key, value).await
Expand Down Expand Up @@ -195,10 +195,10 @@ impl Local {
Err(e) => return Err(Box::new(DstoreError(format!("Global: {}", e)))),
} as usize;
// If VALUE sized larger than single packet transportable, use get_file(), else use get_single()
if size > MAX_BYTE_SIZE {
self.get_file(key).await
} else {
if size < MAX_BYTE_SIZE {
self.get_single(key).await
} else {
self.get_file(key).await
}
}
}
Expand Down

0 comments on commit b49ab40

Please sign in to comment.