Fix --handles_are_files hanging the fetch process by using a much simpler file reading method
This commit is contained in:
parent
2633f655dc
commit
56dfa16b84
1 changed files with 2 additions and 8 deletions
|
@ -15,15 +15,9 @@ pub fn fetch(
|
||||||
) {
|
) {
|
||||||
let handles = handles.flat_map(|handle| {
|
let handles = handles.flat_map(|handle| {
|
||||||
if handles_are_files {
|
if handles_are_files {
|
||||||
match std::fs::File::open(&handle) {
|
match std::fs::read_to_string(&handle) {
|
||||||
Ok(file) => {
|
Ok(file) => {
|
||||||
let mut file = BufReader::new(file);
|
let handles = file.lines().map(str::to_string).collect::<Vec<_>>();
|
||||||
let mut handles = vec![];
|
|
||||||
let mut buf = String::new();
|
|
||||||
while file.read_line(&mut buf).is_ok() {
|
|
||||||
handles.push(buf);
|
|
||||||
buf = String::new();
|
|
||||||
}
|
|
||||||
info!("Read {} handles from {handle}", handles.len());
|
info!("Read {} handles from {handle}", handles.len());
|
||||||
handles
|
handles
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue