mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-25 13:35:54 +00:00
Fix load manager buglets.
This commit is contained in:
@@ -152,7 +152,7 @@ bool LoadManager::shouldCutoff(LoadSource& source) const
|
|||||||
boost::mutex::scoped_lock sl(mLock);
|
boost::mutex::scoped_lock sl(mLock);
|
||||||
int now = upTime();
|
int now = upTime();
|
||||||
canonicalize(source, now);
|
canonicalize(source, now);
|
||||||
if (!source.isPrivileged() || (source.mBalance > mDebitLimit))
|
if (source.isPrivileged() || (source.mBalance > mDebitLimit))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
logDisconnect(source.getName());
|
logDisconnect(source.getName());
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ public:
|
|||||||
jvResult["id"] = jvRequest["id"];
|
jvResult["id"] = jvRequest["id"];
|
||||||
}
|
}
|
||||||
|
|
||||||
theApp->getLoadManager().adjust(mLoadSource, 5);
|
theApp->getLoadManager().adjust(mLoadSource, -5);
|
||||||
return jvResult;
|
return jvResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -131,7 +131,7 @@ public:
|
|||||||
jvResult["result"] = mRPCHandler.doCommand(jvRequest, iRole, cost);
|
jvResult["result"] = mRPCHandler.doCommand(jvRequest, iRole, cost);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (theApp->getLoadManager().adjust(mLoadSource, cost) && theApp->getLoadManager().shouldWarn(mLoadSource))
|
if (theApp->getLoadManager().adjust(mLoadSource, -cost) && theApp->getLoadManager().shouldWarn(mLoadSource))
|
||||||
jvResult["warning"] = "load";
|
jvResult["warning"] = "load";
|
||||||
|
|
||||||
// Currently we will simply unwrap errors returned by the RPC
|
// Currently we will simply unwrap errors returned by the RPC
|
||||||
|
|||||||
Reference in New Issue
Block a user