mirror of
https://github.com/XRPLF/clio.git
synced 2026-06-04 01:06:45 +00:00
try adding sync
This commit is contained in:
@@ -95,7 +95,7 @@ public:
|
||||
|
||||
~CassandraPreparedStatement()
|
||||
{
|
||||
log_.trace() << "called";
|
||||
// log_.trace() << "called";
|
||||
if (prepared_)
|
||||
{
|
||||
cass_prepared_free(prepared_);
|
||||
|
||||
@@ -106,7 +106,11 @@ doMigration(
|
||||
}
|
||||
|
||||
// write what we have
|
||||
backend.writeNFTs(std::move(toWrite));
|
||||
if (toWrite.size() > 0)
|
||||
{
|
||||
backend.writeNFTs(std::move(toWrite));
|
||||
backend.sync();
|
||||
}
|
||||
|
||||
morePages = cass_result_has_more_pages(result);
|
||||
if (morePages)
|
||||
@@ -134,10 +138,15 @@ doMigration(
|
||||
for (auto const& object : page.objects)
|
||||
{
|
||||
std::string blobStr(object.blob.begin(), object.blob.end());
|
||||
backend.writeNFTs(getNFTDataFromObj(
|
||||
ledgerRange->minSequence,
|
||||
ripple::to_string(object.key),
|
||||
blobStr));
|
||||
std::vector<NFTsData> toWrite = getNFTDataFromObj(
|
||||
ledgerRange->minSequence,
|
||||
ripple::to_string(object.key),
|
||||
blobStr);
|
||||
if (toWrite.size() > 0)
|
||||
{
|
||||
backend.writeNFTs(std::move(toWrite));
|
||||
backend.sync();
|
||||
}
|
||||
}
|
||||
cursor = page.cursor;
|
||||
} while (cursor.has_value());
|
||||
@@ -166,6 +175,8 @@ doMigration(
|
||||
throw std::runtime_error(ss.str());
|
||||
}
|
||||
|
||||
backend.sync();
|
||||
|
||||
std::cout << "Completed migration from " << ledgerRange->minSequence
|
||||
<< " to " << ledgerRange->maxSequence << std::endl;
|
||||
}
|
||||
@@ -202,7 +213,6 @@ main(int argc, char* argv[])
|
||||
boost::asio::spawn(
|
||||
ioc, [&backend, &work](boost::asio::yield_context yield) {
|
||||
doMigration(*backend, yield);
|
||||
backend->sync();
|
||||
work.reset();
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user