panic if influxdb_bucket is not set when influxdb_host is set

This commit is contained in:
Bryan Stitt 2023-06-13 09:14:21 -07:00
parent 45543be256
commit 602b0117c4
2 changed files with 11 additions and 0 deletions

@ -378,12 +378,18 @@ impl Web3ProxyApp {
.influxdb_org .influxdb_org
.clone() .clone()
.expect("influxdb_org needed when influxdb_host is set"); .expect("influxdb_org needed when influxdb_host is set");
let influxdb_token = top_config let influxdb_token = top_config
.app .app
.influxdb_token .influxdb_token
.clone() .clone()
.expect("influxdb_token needed when influxdb_host is set"); .expect("influxdb_token needed when influxdb_host is set");
top_config
.app
.influxdb_bucket
.expect("influxdb_bucket needed when influxdb_host is set");
let influxdb_client = let influxdb_client =
influxdb2::Client::new(influxdb_host, influxdb_org, influxdb_token); influxdb2::Client::new(influxdb_host, influxdb_org, influxdb_token);

@ -57,6 +57,11 @@ impl MigrateStatsToV2 {
.clone() .clone()
.expect("influxdb_token needed when influxdb_host is set"); .expect("influxdb_token needed when influxdb_host is set");
top_config
.app
.influxdb_bucket
.expect("influxdb_token needed when influxdb_host is set");
let influxdb_client = let influxdb_client =
influxdb2::Client::new(influxdb_host, influxdb_org, influxdb_token); influxdb2::Client::new(influxdb_host, influxdb_org, influxdb_token);