Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

default ws note #10014

Closed
wants to merge 12 commits into from
3 changes: 3 additions & 0 deletions client/cli/src/commands/run_cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@ pub struct RunCmd {
pub ws_port: Option<u16>,

/// Maximum number of WS RPC server connections.
///
/// Defalt is 100.
// {this is set in client/rpc-servers/src/lib.rs
#[structopt(long = "ws-max-connections", value_name = "COUNT")]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can;t we do something like

#[structopt(long = "ws-max-connections", value_name = "COUNT", default_value="100")]?

And get rid of sc_rpc_server::WS_MAX_CONNECTION?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would also avoid the (likely) miss of the comment needing to be changed if this constant ever changed. grouped in the same lines here would be much easier to spot 👍

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, using default_value doesn't work with using an Option<>. So this change would have quite a bit of ripple effect.

For now, I gues, the updated comment will have to do.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What ripple effect?

pub ws_max_connections: Option<usize>,

Expand Down