refactor: update dependencies and improve logging in validation service

main
Yoo1tic 2025-08-11 02:30:02 +08:00
parent 0eb68e974e
commit 5e1226a2b5
4 changed files with 9 additions and 7 deletions

View File

@ -21,9 +21,9 @@ url = { version = "2.5", features = ["serde"] }
async-stream = "0.3"
figment = { version = "0.10", features = ["env", "toml"] }
serde = { version = "1.0", features = ["derive"] }
toml = "0.9.5"
toml = "0.9"
thiserror = "2.0"
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter", "fmt"] }
tracing-indicatif = "0.3.12"
indicatif = "0.18.0"
tracing-indicatif = "0.3"
indicatif = "0.18"

0
release.sh Normal file → Executable file
View File

View File

@ -21,7 +21,12 @@ async fn main() -> Result<(), ValidatorError> {
tracing_subscriber::registry()
.with(env_filter)
.with(tracing_subscriber::fmt::layer().with_writer(indicatif_layer.get_stderr_writer()))
.with(
tracing_subscriber::fmt::layer()
.with_writer(indicatif_layer.get_stderr_writer())
.with_level(true)
.with_target(false),
)
.with(indicatif_layer)
.init();

View File

@ -8,7 +8,6 @@ use async_stream::stream;
use futures::{pin_mut, stream::StreamExt};
use indicatif::ProgressStyle;
use reqwest::Client;
use std::time::Instant;
use tokio::{fs, io::AsyncWriteExt, sync::mpsc};
use tracing::{Span, error, info_span};
use tracing_indicatif::span_ext::IndicatifSpanExt;
@ -30,7 +29,6 @@ impl ValidationService {
}
pub async fn validate_keys(&self, keys: Vec<GeminiKey>) -> Result<(), ValidatorError> {
let start_time = Instant::now();
let total_keys = keys.len();
// Create channel for streaming keys from producer to consumer
let (tx, mut rx) = mpsc::unbounded_channel::<GeminiKey>();
@ -113,7 +111,6 @@ impl ValidationService {
std::mem::drop(progress_span_enter);
std::mem::drop(progress_span);
println!("Total Elapsed Time: {:?}", start_time.elapsed());
Ok(())
}
}