mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-01 11:06:50 +08:00
feat(router): add configuration support for actix workers (#156)
This commit is contained in:
@ -84,6 +84,7 @@ pub struct Proxy {
|
||||
#[derive(Debug, Deserialize, Clone)]
|
||||
pub struct Server {
|
||||
pub port: u16,
|
||||
pub workers: Option<usize>,
|
||||
pub host: String,
|
||||
pub request_body_limit: usize,
|
||||
pub base_url: String,
|
||||
|
||||
@ -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))
|
||||
|
||||
Reference in New Issue
Block a user