mirror of
https://github.com/XRPLF/clio.git
synced 2026-06-10 12:16:45 +00:00
feat: Limit cache loading in cluster (#2985)
This PR adds an option to limit simultaneous cache loading in a cluster to one node at a time. Fixes #2707
This commit is contained in:
@@ -224,6 +224,7 @@ LedgerCache::setFull()
|
||||
return;
|
||||
|
||||
full_ = true;
|
||||
isCurrentlyLoading_ = false;
|
||||
std::scoped_lock const lck{mtx_};
|
||||
deletes_.clear();
|
||||
}
|
||||
@@ -290,4 +291,16 @@ LedgerCache::loadFromFile(std::string const& path, uint32_t minLatestSequence)
|
||||
return {};
|
||||
}
|
||||
|
||||
void
|
||||
LedgerCache::startLoading()
|
||||
{
|
||||
isCurrentlyLoading_ = true;
|
||||
}
|
||||
|
||||
bool
|
||||
LedgerCache::isCurrentlyLoading() const
|
||||
{
|
||||
return isCurrentlyLoading_;
|
||||
}
|
||||
|
||||
} // namespace data
|
||||
|
||||
Reference in New Issue
Block a user