Unverified Commit fd05b567 authored by Tien Nguyen's avatar Tien Nguyen Committed by GitHub
Browse files

refactor(sgl-router): Replace `once_cell` with `LazyLock` in worker.rs and...

refactor(sgl-router): Replace `once_cell` with `LazyLock` in worker.rs and remove once_cell dependency from Cargo.toml (#8698)
parent 482c3db2
......@@ -25,7 +25,6 @@ dashmap = "6.1.0"
http = "1.1.0"
tokio = { version = "1.42.0", features = ["full"] }
async-trait = "0.1"
once_cell = "1.21"
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter", "json", "chrono"] }
tracing-log = "0.2"
......
use super::{WorkerError, WorkerResult};
use async_trait::async_trait;
use futures;
use once_cell::sync::Lazy;
use serde_json;
use std::fmt;
use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering};
use std::sync::Arc;
use std::sync::{Arc, LazyLock};
// Shared HTTP client for worker operations (health checks, server info, etc.)
static WORKER_CLIENT: Lazy<reqwest::Client> = Lazy::new(|| {
static WORKER_CLIENT: LazyLock<reqwest::Client> = LazyLock::new(|| {
reqwest::Client::builder()
.timeout(std::time::Duration::from_secs(30)) // Default timeout, overridden per request
.build()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment