mirror of
https://github.com/XRPLF/clio.git
synced 2025-11-28 07:35:52 +00:00
impliment book offers for async etl
This commit is contained in:
@@ -280,16 +280,16 @@ doBookOffers(
|
||||
}
|
||||
|
||||
auto start = std::chrono::system_clock::now();
|
||||
std::cout << "getting Book Offers" << std::endl;
|
||||
auto [offers, retCursor] =
|
||||
auto [offers, retCursor, warning] =
|
||||
backend.fetchBookOffers(bookBase, *ledgerSequence, limit, cursor);
|
||||
std::cout << "got Book Offers" << std::endl;
|
||||
|
||||
auto end = std::chrono::system_clock::now();
|
||||
|
||||
BOOST_LOG_TRIVIAL(warning) << "Time loading books from Postgres: "
|
||||
BOOST_LOG_TRIVIAL(warning) << "Time loading books: "
|
||||
<< ((end - start).count() / 1000000000.0);
|
||||
|
||||
if(warning)
|
||||
response["warning"] = *warning;
|
||||
|
||||
response["offers"] = boost::json::value(boost::json::array_kind);
|
||||
boost::json::array& jsonOffers = response.at("offers").as_array();
|
||||
|
||||
@@ -324,6 +324,11 @@ doBookOffers(
|
||||
<< ((end - start).count() / 1000000000.0);
|
||||
if (retCursor)
|
||||
response["cursor"] = ripple::strHex(*retCursor);
|
||||
if (warning)
|
||||
response["warning"] =
|
||||
"Periodic database update in progress. Data for this book as of "
|
||||
"this ledger "
|
||||
"may be incomplete. Data should be complete within one minute";
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user