Skip to content

Commit

Permalink
add basic logs
Browse files Browse the repository at this point in the history
  • Loading branch information
samster25 committed Sep 23, 2023
1 parent 5456504 commit 6a3d465
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/daft-io/src/object_io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,17 +116,21 @@ pub(crate) async fn recursive_iter(
source: Arc<dyn ObjectSource>,
uri: &str,
) -> super::Result<BoxStream<super::Result<FileMetadata>>> {
log::debug!("starting recursive lister with top level of: {uri}");
let (to_rtn_tx, mut to_rtn_rx) = tokio::sync::mpsc::channel(16 * 1024);
fn add_to_channel(
source: Arc<dyn ObjectSource>,
tx: Sender<super::Result<FileMetadata>>,
dir: String,
) {
log::debug!("spawning task to list: {dir}");
tokio::spawn(async move {
let s = source.iter_dir(&dir, None, None).await;
log::debug!("started listing task for {dir}");
let mut s = match s {
Ok(s) => s,
Err(e) => {
log::debug!("Error occured when listing {dir}\nerror:\n{e}");
tx.send(Err(e)).await.map_err(|se| {
super::Error::UnableToSendDataOverChannel { source: se.into() }
})?;
Expand All @@ -142,6 +146,7 @@ pub(crate) async fn recursive_iter(
.await
.map_err(|e| super::Error::UnableToSendDataOverChannel { source: e.into() })?;
}
log::debug!("completed listing task for {dir}");
super::Result::Ok(())
});
}
Expand Down

0 comments on commit 6a3d465

Please sign in to comment.