Improve etl check (#1465)

Fix #1444
This commit is contained in:
cyan317
2024-06-17 11:52:39 +01:00
committed by GitHub
parent 37cd79ceb0
commit 5ba08b1d26
2 changed files with 27 additions and 15 deletions

View File

@@ -123,10 +123,8 @@ LoadBalancer::LoadBalancer(
auto const stateOpt = ETLState::fetchETLStateFromSource(*source);
if (!stateOpt) {
checkOnETLFailure(fmt::format(
"Failed to fetch ETL state from source = {} Please check the configuration and network",
source->toString()
));
LOG(log_.warn()) << "Failed to fetch ETL state from source = " << source->toString()
<< " Please check the configuration and network";
} else if (etlState_ && etlState_->networkID && stateOpt->networkID &&
etlState_->networkID != stateOpt->networkID) {
checkOnETLFailure(fmt::format(
@@ -142,6 +140,9 @@ LoadBalancer::LoadBalancer(
LOG(log_.info()) << "Added etl source - " << sources_.back()->toString();
}
if (!etlState_)
checkOnETLFailure("Failed to fetch ETL state from any source. Please check the configuration and network");
if (sources_.empty())
checkOnETLFailure("No ETL sources configured. Please check the configuration");