fix parsing of use_grpc env var (#378)

This commit is contained in:
Lou-Kamades 2024-04-02 10:21:46 +02:00 committed by GitHub
parent 1e956a2b4f
commit 4d7700145e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View File

@ -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": {

View File

@ -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)]
@ -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