2
0
Fork 0
mirror of https://git.asonix.dog/asonix/pict-rs synced 2024-12-22 19:31:35 +00:00

Remove serde-cbor, num_cpus

This commit is contained in:
asonix 2023-09-24 15:22:30 -05:00
parent fd965bb1a5
commit e0968dcce3
3 changed files with 5 additions and 21 deletions

18
Cargo.lock generated
View file

@ -1034,12 +1034,6 @@ dependencies = [
"tracing",
]
[[package]]
name = "half"
version = "1.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7"
[[package]]
name = "hashbrown"
version = "0.12.3"
@ -1833,7 +1827,6 @@ dependencies = [
"metrics",
"metrics-exporter-prometheus",
"mime",
"num_cpus",
"once_cell",
"opentelemetry",
"opentelemetry-otlp",
@ -1846,7 +1839,6 @@ dependencies = [
"rusty-s3",
"serde",
"serde-tuple-vec-map",
"serde_cbor",
"serde_json",
"serde_urlencoded",
"sha2",
@ -2460,16 +2452,6 @@ dependencies = [
"serde",
]
[[package]]
name = "serde_cbor"
version = "0.11.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2bef2ebfde456fb76bbcf9f59315333decc4fda0b2b44b420243c11e0f5ec1f5"
dependencies = [
"half",
"serde",
]
[[package]]
name = "serde_derive"
version = "1.0.188"

View file

@ -38,7 +38,6 @@ md-5 = "0.10.5"
metrics = "0.21.1"
metrics-exporter-prometheus = { version = "0.12.1", default-features = false, features = ["http-listener"] }
mime = "0.3.1"
num_cpus = "1.13"
once_cell = "1.4.0"
opentelemetry = { version = "0.20", features = ["rt-tokio"] }
opentelemetry-otlp = "0.13"
@ -51,7 +50,6 @@ reqwest-tracing = { version = "0.4.5" }
rusty-s3 = "0.4.1"
serde = { version = "1.0", features = ["derive"] }
serde-tuple-vec-map = "1.0.1"
serde_cbor = "0.11.2"
serde_json = "1.0"
serde_urlencoded = "0.7.1"
sha2 = "0.10.0"

View file

@ -89,7 +89,11 @@ const DAYS: u32 = 24 * HOURS;
const NOT_FOUND_KEY: &str = "404-alias";
static PROCESS_SEMAPHORE: Lazy<Semaphore> = Lazy::new(|| {
let permits = num_cpus::get().saturating_sub(1).max(1);
let permits = std::thread::available_parallelism()
.map(usize::from)
.unwrap_or(1)
.saturating_sub(1)
.max(1);
crate::sync::bare_semaphore(permits)
});