Don't let ledger fetching go too fast.

This commit is contained in:
JoelKatz
2013-03-12 15:17:26 -07:00
parent 0b52905cb7
commit e9a02882f1
4 changed files with 13 additions and 4 deletions

View File

@@ -118,6 +118,14 @@ int JobQueue::getJobCount(JobType t)
return (c == mJobCounts.end()) ? 0 : c->second.first;
}
int JobQueue::getJobCountTotal(JobType t)
{
boost::mutex::scoped_lock sl(mJobLock);
std::map< JobType, std::pair<int, int> >::iterator c = mJobCounts.find(t);
return (c == mJobCounts.end()) ? 0 : (c->second.first + c->second.second);
}
int JobQueue::getJobCountGE(JobType t)
{ // return the number of jobs at this priority level or greater
int ret = 0;