Make default peer connect timeout less = 2s
This commit is contained in:
parent
123859328f
commit
4a331d97c9
1 changed files with 6 additions and 6 deletions
|
|
@ -58,12 +58,12 @@ struct Opts {
|
||||||
disable_dht_persistence: bool,
|
disable_dht_persistence: bool,
|
||||||
|
|
||||||
/// The connect timeout, e.g. 1s, 1.5s, 100ms etc.
|
/// The connect timeout, e.g. 1s, 1.5s, 100ms etc.
|
||||||
#[arg(long = "peer-connect-timeout", value_parser = parse_duration::parse)]
|
#[arg(long = "peer-connect-timeout", value_parser = parse_duration::parse, default_value="2s")]
|
||||||
peer_connect_timeout: Option<Duration>,
|
peer_connect_timeout: Duration,
|
||||||
|
|
||||||
/// The connect timeout, e.g. 1s, 1.5s, 100ms etc.
|
/// The connect timeout, e.g. 1s, 1.5s, 100ms etc.
|
||||||
#[arg(long = "peer-read-write-timeout" , value_parser = parse_duration::parse)]
|
#[arg(long = "peer-read-write-timeout" , value_parser = parse_duration::parse, default_value="10s")]
|
||||||
peer_read_write_timeout: Option<Duration>,
|
peer_read_write_timeout: Duration,
|
||||||
|
|
||||||
/// How many threads to spawn for the executor.
|
/// How many threads to spawn for the executor.
|
||||||
#[arg(short = 't', long)]
|
#[arg(short = 't', long)]
|
||||||
|
|
@ -229,8 +229,8 @@ async fn async_main(opts: Opts, spawner: BlockingSpawner) -> anyhow::Result<()>
|
||||||
dht_config: None,
|
dht_config: None,
|
||||||
peer_id: None,
|
peer_id: None,
|
||||||
peer_opts: Some(PeerConnectionOptions {
|
peer_opts: Some(PeerConnectionOptions {
|
||||||
connect_timeout: opts.peer_connect_timeout,
|
connect_timeout: Some(opts.peer_connect_timeout),
|
||||||
read_write_timeout: opts.peer_read_write_timeout,
|
read_write_timeout: Some(opts.peer_read_write_timeout),
|
||||||
..Default::default()
|
..Default::default()
|
||||||
}),
|
}),
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue