feat(router): add configuration support for actix workers (#156)

This commit is contained in:
Sampras Lopes
2022-12-15 20:24:10 +05:30
committed by GitHub
parent e5ea411fb0
commit bd19dad616
6 changed files with 7 additions and 3 deletions

View File

@ -133,6 +133,7 @@ pub async fn start_server(conf: Settings) -> BachResult<(Server, AppState)> {
let request_body_limit = server.request_body_limit;
let server = actix_web::HttpServer::new(move || mk_app(state.clone(), request_body_limit))
.bind((server.host.as_str(), server.port))?
.workers(server.workers.unwrap_or_else(num_cpus::get_physical))
.run();
Ok((server, app_state))