feat: format key output in write_keys_txt_file and ensure buffer flush in validation service
parent
96ac85072e
commit
486a9afd8e
|
@ -9,7 +9,7 @@ pub async fn write_keys_txt_file(
|
|||
file: &mut BufWriter<tokio::fs::File>,
|
||||
key: &ApiKey,
|
||||
) -> Result<()> {
|
||||
file.write_all(key.as_str().as_bytes()).await?;
|
||||
file.write_all(format!("{}\n", key.as_str()).as_bytes()).await?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ use async_stream::stream;
|
|||
use futures::{pin_mut, stream::StreamExt};
|
||||
use reqwest::Client;
|
||||
use std::time::Instant;
|
||||
use tokio::{fs, sync::mpsc};
|
||||
use tokio::{fs, io::AsyncWriteExt, sync::mpsc};
|
||||
|
||||
use crate::adapters::write_keys_txt_file;
|
||||
use crate::config::KeyCheckerConfig;
|
||||
|
@ -59,6 +59,9 @@ impl ValidationService {
|
|||
}
|
||||
}
|
||||
|
||||
// Flush the buffer to ensure all data is written to the file
|
||||
buffer_writer.flush().await?;
|
||||
|
||||
println!("Total Elapsed Time: {:?}", start_time.elapsed());
|
||||
Ok(())
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue