mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Defer acquire timeouts if ledger data is backing up.
This commit is contained in:
@@ -73,9 +73,17 @@ void PeerSet::TimerEntry(boost::weak_ptr<PeerSet> wptr, const boost::system::err
|
|||||||
return;
|
return;
|
||||||
boost::shared_ptr<PeerSet> ptr = wptr.lock();
|
boost::shared_ptr<PeerSet> ptr = wptr.lock();
|
||||||
if (ptr)
|
if (ptr)
|
||||||
theApp->getJobQueue().addJob(jtLEDGER_DATA, "timerEntry",
|
{
|
||||||
|
int jc = theApp->getJobQueue().getJobCountTotal(jtLEDGER_DATA);
|
||||||
|
if (jc > 4)
|
||||||
|
{
|
||||||
|
cLog(lsDEBUG) << "Deferring PeerSet timer due to load";
|
||||||
|
ptr->setTimer();
|
||||||
|
}
|
||||||
|
else theApp->getJobQueue().addJob(jtLEDGER_DATA, "timerEntry",
|
||||||
BIND_TYPE(&PeerSet::TimerJobEntry, P_1, ptr));
|
BIND_TYPE(&PeerSet::TimerJobEntry, P_1, ptr));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void PeerSet::TimerJobEntry(Job&, boost::shared_ptr<PeerSet> ptr)
|
void PeerSet::TimerJobEntry(Job&, boost::shared_ptr<PeerSet> ptr)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user