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| {
|
||||
if handles_are_files {
|
||||
match std::fs::File::open(&handle) {
|
||||
match std::fs::read_to_string(&handle) {
|
||||
Ok(file) => {
|
||||
let mut file = BufReader::new(file);
|
||||
let mut handles = vec![];
|
||||
let mut buf = String::new();
|
||||
while file.read_line(&mut buf).is_ok() {
|
||||
handles.push(buf);
|
||||
buf = String::new();
|
||||
}
|
||||
let handles = file.lines().map(str::to_string).collect::<Vec<_>>();
|
||||
info!("Read {} handles from {handle}", handles.len());
|
||||
handles
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue