refactor(sgl-router): Replace once_cell with LazyLock in worker.rs and remove once_cell dependency from Cargo.toml (#8698)
This commit is contained in:
@@ -25,7 +25,6 @@ dashmap = "6.1.0"
|
|||||||
http = "1.1.0"
|
http = "1.1.0"
|
||||||
tokio = { version = "1.42.0", features = ["full"] }
|
tokio = { version = "1.42.0", features = ["full"] }
|
||||||
async-trait = "0.1"
|
async-trait = "0.1"
|
||||||
once_cell = "1.21"
|
|
||||||
tracing = "0.1"
|
tracing = "0.1"
|
||||||
tracing-subscriber = { version = "0.3", features = ["env-filter", "json", "chrono"] }
|
tracing-subscriber = { version = "0.3", features = ["env-filter", "json", "chrono"] }
|
||||||
tracing-log = "0.2"
|
tracing-log = "0.2"
|
||||||
|
|||||||
@@ -1,14 +1,13 @@
|
|||||||
use super::{WorkerError, WorkerResult};
|
use super::{WorkerError, WorkerResult};
|
||||||
use async_trait::async_trait;
|
use async_trait::async_trait;
|
||||||
use futures;
|
use futures;
|
||||||
use once_cell::sync::Lazy;
|
|
||||||
use serde_json;
|
use serde_json;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering};
|
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.)
|
// 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()
|
reqwest::Client::builder()
|
||||||
.timeout(std::time::Duration::from_secs(30)) // Default timeout, overridden per request
|
.timeout(std::time::Duration::from_secs(30)) // Default timeout, overridden per request
|
||||||
.build()
|
.build()
|
||||||
|
|||||||
Reference in New Issue
Block a user