Skip to content

Commit

Permalink
fix parsing of use_grpc env var (#378)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lou-Kamades committed Apr 2, 2024
1 parent 1e956a2 commit 4d77001
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion config.example.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"transaction_retry_after_secs": 3,
"quic_proxy_addr": null,
"use_grpc": false,
"calculate_leader_schedule_form_geyser": false,
"calculate_leader_schedule_from_geyser": false,
"grpc_addr": "http://127.0.0.0:10000",
"grpc_x_token": null,
"postgres": {
Expand Down
4 changes: 2 additions & 2 deletions lite-rpc/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ pub struct Config {
#[serde(default)]
pub use_grpc: bool,
#[serde(default)]
pub calculate_leader_schedule_form_geyser: bool,
pub calculate_leader_schedule_from_geyser: bool,
#[serde(default = "Config::default_grpc_addr")]
pub grpc_addr: String,
#[serde(default)]
Expand Down Expand Up @@ -161,7 +161,7 @@ impl Config {
config.quic_proxy_addr = env::var("QUIC_PROXY_ADDR").ok();

config.use_grpc = env::var("USE_GRPC")
.map(|_| true)
.map(|value| value.parse::<bool>().unwrap())
.unwrap_or(config.use_grpc);

// source 1
Expand Down

0 comments on commit 4d77001

Please sign in to comment.