mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-30 20:07:56 +00:00
rpc-http-threads cli arg (#8890)
* Add optional `rpc-http-threads` cli arg * Update `http::ServerBuilder`threads
This commit is contained in:
@@ -122,6 +122,10 @@ pub struct RunCmd {
|
||||
#[structopt(long = "ws-max-connections", value_name = "COUNT")]
|
||||
pub ws_max_connections: Option<usize>,
|
||||
|
||||
/// Size of the RPC HTTP server thread pool.
|
||||
#[structopt(long = "rpc-http-threads", value_name = "COUNT")]
|
||||
pub rpc_http_threads: Option<usize>,
|
||||
|
||||
/// Specify browser Origins allowed to access the HTTP & WS RPC servers.
|
||||
///
|
||||
/// A comma-separated list of origins (protocol://domain or special `null`
|
||||
@@ -376,6 +380,10 @@ impl CliConfiguration for RunCmd {
|
||||
Ok(self.ws_max_connections)
|
||||
}
|
||||
|
||||
fn rpc_http_threads(&self) -> Result<Option<usize>> {
|
||||
Ok(self.rpc_http_threads)
|
||||
}
|
||||
|
||||
fn rpc_cors(&self, is_dev: bool) -> Result<Option<Vec<String>>> {
|
||||
Ok(self
|
||||
.rpc_cors
|
||||
|
||||
@@ -358,6 +358,13 @@ pub trait CliConfiguration<DCV: DefaultConfigurationValues = ()>: Sized {
|
||||
Ok(None)
|
||||
}
|
||||
|
||||
/// Get the RPC HTTP thread pool size (`None` for a default 4-thread pool config).
|
||||
///
|
||||
/// By default this is `None`.
|
||||
fn rpc_http_threads(&self) -> Result<Option<usize>> {
|
||||
Ok(None)
|
||||
}
|
||||
|
||||
/// Get the RPC cors (`None` if disabled)
|
||||
///
|
||||
/// By default this is `Some(Vec::new())`.
|
||||
@@ -526,6 +533,7 @@ pub trait CliConfiguration<DCV: DefaultConfigurationValues = ()>: Sized {
|
||||
rpc_ipc: self.rpc_ipc()?,
|
||||
rpc_methods: self.rpc_methods()?,
|
||||
rpc_ws_max_connections: self.rpc_ws_max_connections()?,
|
||||
rpc_http_threads: self.rpc_http_threads()?,
|
||||
rpc_cors: self.rpc_cors(is_dev)?,
|
||||
prometheus_config: self.prometheus_config(DCV::prometheus_listen_port())?,
|
||||
telemetry_endpoints,
|
||||
|
||||
Reference in New Issue
Block a user