[code] replace num_cpus by std:🧵:available_parallelism
This commit is contained in:
@ -2,6 +2,7 @@ use actix_web::{App, HttpServer};
|
||||
use std::env;
|
||||
use std::net::IpAddr;
|
||||
use std::net::SocketAddr;
|
||||
use std::thread::available_parallelism;
|
||||
|
||||
use clap::{crate_name, crate_version, Parser};
|
||||
|
||||
@ -37,7 +38,7 @@ async fn main() -> std::io::Result<()> {
|
||||
.prefer_utf8(true),
|
||||
)
|
||||
})
|
||||
.workers(num_cpus::get())
|
||||
.workers(available_parallelism().unwrap().get())
|
||||
.bind(sock)?
|
||||
.run()
|
||||
.await
|
||||
|
Reference in New Issue
Block a user