summaryrefslogtreecommitdiff
path: root/src/files.rs
diff options
context:
space:
mode:
authorjakka <jakkadoujin@gmail.com>2025-07-02 12:11:46 +0300
committerjakka <jakkadoujin@gmail.com>2025-07-02 12:11:46 +0300
commite19557f6dd5b22334fa0cc8830229d64de4fcab9 (patch)
tree3c256a6cfceb52df29f9db149f9ecfebd5d9c3c5 /src/files.rs
parente76cbad014263ce9233122def59c551770a902b5 (diff)
continued working
Diffstat (limited to 'src/files.rs')
-rw-r--r--src/files.rs17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/files.rs b/src/files.rs
index b3f9e75..e6bd870 100644
--- a/src/files.rs
+++ b/src/files.rs
@@ -8,6 +8,7 @@ use smol::{
Executor,
fs::{File, metadata},
};
+use std::time;
use std::{
error::Error,
fmt::Display,
@@ -17,7 +18,7 @@ use std::{
atomic::{AtomicBool, Ordering},
mpsc,
},
- time::UNIX_EPOCH,
+ time::{Duration, UNIX_EPOCH},
};
use walkdir::WalkDir;
@@ -115,6 +116,15 @@ pub fn index_files_recursively(
let newbar = bar.clone();
ex.spawn(async move {
+ std::thread::sleep(Duration::from_secs(2));
+ println!("reached");
+ let _ = newtx.send(FileError::new(path, anyhow!("error!")));
+ #[cfg(not(test))]
+ newbar.inc(1);
+ })
+ .detach();
+
+ /* ex.spawn(async move {
if !newrunning.load(Ordering::SeqCst) {
match handle_file(&path, newconn).await {
Err(error) => newtx.send(FileError::new(path, error)),
@@ -128,7 +138,7 @@ pub fn index_files_recursively(
Ok(())
}
})
- .detach();
+ .detach(); */
#[cfg(not(test))]
bar.inc_length(1);
@@ -136,8 +146,9 @@ pub fn index_files_recursively(
}
}
+ drop(tx);
+
while !ex.is_empty() {
- println!("reached");
if let Ok(message) = rx.recv() {
eprintln!("{}", message);
}