From d3681df253538efd83ced6ec9045c77aa4d5ef4f Mon Sep 17 00:00:00 2001 From: CJ Cobb Date: Thu, 17 Mar 2022 12:39:34 -0400 Subject: [PATCH] publish ledgers closed in the last ten minutes --- src/etl/ReportingETL.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/etl/ReportingETL.cpp b/src/etl/ReportingETL.cpp index db104299..69266dfd 100644 --- a/src/etl/ReportingETL.cpp +++ b/src/etl/ReportingETL.cpp @@ -701,15 +701,17 @@ ReportingETL::runETLPipeline(uint32_t startSequence, int numExtractors) .count(); auto closeTime = lgrInfo.closeTime.time_since_epoch().count(); auto age = now - (rippleEpochStart + closeTime); - // if the ledger closed over 10 seconds ago, assume we are still + // if the ledger closed over 10 minutes ago, assume we are still // catching up and don't publish - if (age < 10) - { + if (age < 600) boost::asio::post( publishStrand_, [this, lgrInfo = lgrInfo]() { publishLedger(lgrInfo); }); - } + else + BOOST_LOG_TRIVIAL(info) + << "Skipping publishing old ledger. seq = " + << lgrInfo.seq; lastPublishedSequence = lgrInfo.seq; }