mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Properly handle empty optionals in DB lookups
This commit is contained in:
@@ -941,7 +941,7 @@ ETLLoadBalancer::execute(Func f, uint32_t ledgerSequence)
|
||||
<< "Error executing function. "
|
||||
<< " Tried all sources, but ledger was found in db."
|
||||
<< " Sequence = " << ledgerSequence;
|
||||
break;
|
||||
return false;
|
||||
}
|
||||
JLOG(journal_.error())
|
||||
<< __func__ << " : "
|
||||
|
||||
@@ -524,14 +524,6 @@ ReportingETL::runETLPipeline(uint32_t startSequence)
|
||||
auto start = std::chrono::system_clock::now();
|
||||
std::optional<org::xrpl::rpc::v1::GetLedgerResponse> fetchResponse{
|
||||
fetchLedgerDataAndDiff(currentSequence)};
|
||||
auto end = std::chrono::system_clock::now();
|
||||
|
||||
auto time = ((end - start).count()) / 1000000000.0;
|
||||
auto tps =
|
||||
fetchResponse->transactions_list().transactions_size() / time;
|
||||
|
||||
JLOG(journal_.debug()) << "Extract phase time = " << time
|
||||
<< " . Extract phase tps = " << tps;
|
||||
// if the fetch is unsuccessful, stop. fetchLedger only returns
|
||||
// false if the server is shutting down, or if the ledger was
|
||||
// found in the database (which means another process already
|
||||
@@ -543,6 +535,14 @@ ReportingETL::runETLPipeline(uint32_t startSequence)
|
||||
{
|
||||
break;
|
||||
}
|
||||
auto end = std::chrono::system_clock::now();
|
||||
|
||||
auto time = ((end - start).count()) / 1000000000.0;
|
||||
auto tps =
|
||||
fetchResponse->transactions_list().transactions_size() / time;
|
||||
|
||||
JLOG(journal_.debug()) << "Extract phase time = " << time
|
||||
<< " . Extract phase tps = " << tps;
|
||||
|
||||
transformQueue.push(std::move(fetchResponse));
|
||||
++currentSequence;
|
||||
|
||||
Reference in New Issue
Block a user