mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-16 17:15:51 +00:00
Compare commits
2 Commits
smart-escr
...
vlntb/inbo
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
607d0f7e02 | ||
|
|
8461c7d0b6 |
@@ -384,17 +384,10 @@ public:
|
|||||||
{
|
{
|
||||||
auto const start = m_clock.now();
|
auto const start = m_clock.now();
|
||||||
|
|
||||||
// Make a list of things to sweep, while holding the lock
|
|
||||||
std::vector<MapType::mapped_type> stuffToSweep;
|
|
||||||
std::size_t total;
|
|
||||||
|
|
||||||
{
|
{
|
||||||
ScopedLockType sl(mLock);
|
ScopedLockType sl(mLock);
|
||||||
MapType::iterator it(mLedgers.begin());
|
MapType::iterator it(mLedgers.begin());
|
||||||
total = mLedgers.size();
|
|
||||||
|
|
||||||
stuffToSweep.reserve(total);
|
|
||||||
|
|
||||||
while (it != mLedgers.end())
|
while (it != mLedgers.end())
|
||||||
{
|
{
|
||||||
auto const la = it->second->getLastAction();
|
auto const la = it->second->getLastAction();
|
||||||
@@ -404,11 +397,8 @@ public:
|
|||||||
it->second->touch();
|
it->second->touch();
|
||||||
++it;
|
++it;
|
||||||
}
|
}
|
||||||
else if ((la + std::chrono::minutes(1)) < start)
|
else if ((la + std::chrono::seconds(10)) < start)
|
||||||
{
|
{
|
||||||
stuffToSweep.push_back(it->second);
|
|
||||||
// shouldn't cause the actual final delete
|
|
||||||
// since we are holding a reference in the vector.
|
|
||||||
it = mLedgers.erase(it);
|
it = mLedgers.erase(it);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -419,14 +409,6 @@ public:
|
|||||||
|
|
||||||
beast::expire(mRecentFailures, kReacquireInterval);
|
beast::expire(mRecentFailures, kReacquireInterval);
|
||||||
}
|
}
|
||||||
|
|
||||||
JLOG(j_.debug())
|
|
||||||
<< "Swept " << stuffToSweep.size() << " out of " << total
|
|
||||||
<< " inbound ledgers. Duration: "
|
|
||||||
<< std::chrono::duration_cast<std::chrono::milliseconds>(
|
|
||||||
m_clock.now() - start)
|
|
||||||
.count()
|
|
||||||
<< "ms";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|||||||
Reference in New Issue
Block a user