Merge branch 'main' into issue8371

This commit is contained in:
Arya 2024-04-17 20:01:03 -04:00 committed by GitHub
commit 4fc1c008bc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 0 deletions

View File

@ -502,6 +502,12 @@ impl FinalizedState {
let network = self.network();
rt.block_on(async move {
// Send a ping to the server to check if it is available before inserting.
if client.ping().send().await.is_err() {
tracing::error!("Elasticsearch is not available, skipping block indexing");
return;
}
let response = client
.bulk(elasticsearch::BulkParts::Index(
format!("zcash_{}", network.to_string().to_lowercase()).as_str(),