Skip to content

Commit

Permalink
address feedback from PR
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Caswell committed Sep 8, 2023
1 parent 9a95661 commit c898f65
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions sdk/core/src/tokio/fs.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
use crate::{request::Body, seekable_stream::SeekableStream, setters};
use crate::{
request::Body,
seekable_stream::{SeekableStream, DEFAULT_BUFFER_SIZE},
setters,
};
use futures::{task::Poll, Future};
use std::{cmp::min, io::SeekFrom, pin::Pin, sync::Arc, task::Context};
use tokio::{
Expand Down Expand Up @@ -40,7 +44,7 @@ impl FileStreamBuilder {
pub async fn build(mut self) -> crate::Result<FileStream> {
let stream_size = self.handle.metadata().await?.len();

let buffer_size = self.buffer_size.unwrap_or(1024 * 64);
let buffer_size = self.buffer_size.unwrap_or(DEFAULT_BUFFER_SIZE);

let offset = if let Some(offset) = self.offset {
self.handle.seek(SeekFrom::Start(offset)).await?;
Expand Down Expand Up @@ -87,7 +91,7 @@ impl FileStream {
/// Resets the number of bytes that will be read from this instance to the
/// `stream_size`
///
/// This is useful if you want to read the stream in mutliple blocks
/// This is useful if you want to read the stream in multiple blocks
pub async fn next_block(&mut self) -> crate::Result<()> {
log::info!("setting limit to {}", self.block_size);
let mut handle = self.handle.clone().lock_owned().await;
Expand Down

0 comments on commit c898f65

Please sign in to comment.