refactor: update dependencies and improve logging in validation service
parent
0eb68e974e
commit
5e1226a2b5
|
@ -21,9 +21,9 @@ url = { version = "2.5", features = ["serde"] }
|
||||||
async-stream = "0.3"
|
async-stream = "0.3"
|
||||||
figment = { version = "0.10", features = ["env", "toml"] }
|
figment = { version = "0.10", features = ["env", "toml"] }
|
||||||
serde = { version = "1.0", features = ["derive"] }
|
serde = { version = "1.0", features = ["derive"] }
|
||||||
toml = "0.9.5"
|
toml = "0.9"
|
||||||
thiserror = "2.0"
|
thiserror = "2.0"
|
||||||
tracing = "0.1"
|
tracing = "0.1"
|
||||||
tracing-subscriber = { version = "0.3", features = ["env-filter", "fmt"] }
|
tracing-subscriber = { version = "0.3", features = ["env-filter", "fmt"] }
|
||||||
tracing-indicatif = "0.3.12"
|
tracing-indicatif = "0.3"
|
||||||
indicatif = "0.18.0"
|
indicatif = "0.18"
|
||||||
|
|
|
@ -21,7 +21,12 @@ async fn main() -> Result<(), ValidatorError> {
|
||||||
|
|
||||||
tracing_subscriber::registry()
|
tracing_subscriber::registry()
|
||||||
.with(env_filter)
|
.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)
|
.with(indicatif_layer)
|
||||||
.init();
|
.init();
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,6 @@ use async_stream::stream;
|
||||||
use futures::{pin_mut, stream::StreamExt};
|
use futures::{pin_mut, stream::StreamExt};
|
||||||
use indicatif::ProgressStyle;
|
use indicatif::ProgressStyle;
|
||||||
use reqwest::Client;
|
use reqwest::Client;
|
||||||
use std::time::Instant;
|
|
||||||
use tokio::{fs, io::AsyncWriteExt, sync::mpsc};
|
use tokio::{fs, io::AsyncWriteExt, sync::mpsc};
|
||||||
use tracing::{Span, error, info_span};
|
use tracing::{Span, error, info_span};
|
||||||
use tracing_indicatif::span_ext::IndicatifSpanExt;
|
use tracing_indicatif::span_ext::IndicatifSpanExt;
|
||||||
|
@ -30,7 +29,6 @@ impl ValidationService {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn validate_keys(&self, keys: Vec<GeminiKey>) -> Result<(), ValidatorError> {
|
pub async fn validate_keys(&self, keys: Vec<GeminiKey>) -> Result<(), ValidatorError> {
|
||||||
let start_time = Instant::now();
|
|
||||||
let total_keys = keys.len();
|
let total_keys = keys.len();
|
||||||
// Create channel for streaming keys from producer to consumer
|
// Create channel for streaming keys from producer to consumer
|
||||||
let (tx, mut rx) = mpsc::unbounded_channel::<GeminiKey>();
|
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_enter);
|
||||||
std::mem::drop(progress_span);
|
std::mem::drop(progress_span);
|
||||||
|
|
||||||
println!("Total Elapsed Time: {:?}", start_time.elapsed());
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue