From 602b0117c4a9fef45d3d1ae372539acb2a078650 Mon Sep 17 00:00:00 2001 From: Bryan Stitt Date: Tue, 13 Jun 2023 09:14:21 -0700 Subject: [PATCH] panic if influxdb_bucket is not set when influxdb_host is set --- web3_proxy/src/app/mod.rs | 6 ++++++ web3_proxy/src/bin/web3_proxy_cli/migrate_stats_to_v2.rs | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/web3_proxy/src/app/mod.rs b/web3_proxy/src/app/mod.rs index 9571d949..41747e1a 100644 --- a/web3_proxy/src/app/mod.rs +++ b/web3_proxy/src/app/mod.rs @@ -378,12 +378,18 @@ impl Web3ProxyApp { .influxdb_org .clone() .expect("influxdb_org needed when influxdb_host is set"); + let influxdb_token = top_config .app .influxdb_token .clone() .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 = influxdb2::Client::new(influxdb_host, influxdb_org, influxdb_token); diff --git a/web3_proxy/src/bin/web3_proxy_cli/migrate_stats_to_v2.rs b/web3_proxy/src/bin/web3_proxy_cli/migrate_stats_to_v2.rs index 75823b0f..175aefdf 100644 --- a/web3_proxy/src/bin/web3_proxy_cli/migrate_stats_to_v2.rs +++ b/web3_proxy/src/bin/web3_proxy_cli/migrate_stats_to_v2.rs @@ -57,6 +57,11 @@ impl MigrateStatsToV2 { .clone() .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 = influxdb2::Client::new(influxdb_host, influxdb_org, influxdb_token);