mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-01 08:25:51 +00:00
Clean up old acquires.
This commit is contained in:
@@ -275,6 +275,7 @@ void Application::sweep()
|
|||||||
mLedgerMaster.sweep();
|
mLedgerMaster.sweep();
|
||||||
mTempNodeCache.sweep();
|
mTempNodeCache.sweep();
|
||||||
mValidations.sweep();
|
mValidations.sweep();
|
||||||
|
getMasterLedgerAcquire().sweep();
|
||||||
mSweepTimer.expires_from_now(boost::posix_time::seconds(60));
|
mSweepTimer.expires_from_now(boost::posix_time::seconds(60));
|
||||||
mSweepTimer.async_wait(boost::bind(&Application::sweep, this));
|
mSweepTimer.async_wait(boost::bind(&Application::sweep, this));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -724,4 +724,18 @@ bool LedgerAcquireMaster::isFailure(const uint256& hash)
|
|||||||
return mRecentFailures.find(hash) != mRecentFailures.end();
|
return mRecentFailures.find(hash) != mRecentFailures.end();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void LedgerAcquireMaster::sweep()
|
||||||
|
{
|
||||||
|
boost::mutex::scoped_lock sl(mLock);
|
||||||
|
|
||||||
|
std::map<uint256, LedgerAcquire::pointer>::iterator it = mLedgers.begin();
|
||||||
|
while (it != mLedgers.end())
|
||||||
|
{
|
||||||
|
if (it->second->isDone())
|
||||||
|
mLedgers.erase(it++);
|
||||||
|
else
|
||||||
|
++it;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// vim:ts=4
|
// vim:ts=4
|
||||||
|
|||||||
@@ -133,6 +133,8 @@ public:
|
|||||||
|
|
||||||
void logFailure(const uint256&);
|
void logFailure(const uint256&);
|
||||||
bool isFailure(const uint256&);
|
bool isFailure(const uint256&);
|
||||||
|
|
||||||
|
void sweep();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user