mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-03 06:35:08 -04:00
fixed up the update of message count using a flag to only update when necessary, which limits drastically the calls to getGroupsStatistics()
This commit is contained in:
parent
65af73f8eb
commit
5c71a46c52
4 changed files with 42 additions and 16 deletions
|
@ -335,14 +335,6 @@ RsTokenService::GxsRequestStatus RsGxsDataAccess::requestStatus(uint32_t token)
|
|||
uint32_t anstype;
|
||||
rstime_t ts;
|
||||
|
||||
// {
|
||||
// RS_STACK_MUTEX(mDataMutex);
|
||||
//
|
||||
// // first check public tokens
|
||||
// if(mPublicToken.find(token) != mPublicToken.end())
|
||||
// return mPublicToken[token];
|
||||
// }
|
||||
|
||||
if (!checkRequestStatus(token, status, reqtype, anstype, ts))
|
||||
return RsTokenService::FAILED;
|
||||
|
||||
|
@ -724,9 +716,6 @@ GxsRequest* RsGxsDataAccess::locked_retrieveCompetedRequest(const uint32_t& toke
|
|||
void RsGxsDataAccess::processRequests()
|
||||
{
|
||||
// process requests
|
||||
#ifdef DATA_DEBUG
|
||||
RsDbg() << "processing requests" << std::endl;
|
||||
#endif
|
||||
|
||||
while (!mRequestQueue.empty())
|
||||
{
|
||||
|
@ -762,6 +751,7 @@ void RsGxsDataAccess::processRequests()
|
|||
case PENDING:
|
||||
req = mRequestQueue.begin()->second;
|
||||
req->status = PARTIAL;
|
||||
mRequestQueue.erase(mRequestQueue.begin()); // remove it right away from the waiting queue.
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -1486,7 +1476,7 @@ bool RsGxsDataAccess::getGroupStatistic(GroupStatisticRequest *req)
|
|||
GxsMsgMetaResult metaResult;
|
||||
mDataStore->retrieveGxsMsgMetaData(metaReq, metaResult);
|
||||
|
||||
std::vector<RsGxsMsgMetaData*>& msgMetaV = metaResult[req->mGrpId];
|
||||
const std::vector<RsGxsMsgMetaData*>& msgMetaV = metaResult[req->mGrpId];
|
||||
|
||||
req->mGroupStatistic.mGrpId = req->mGrpId;
|
||||
req->mGroupStatistic.mNumMsgs = msgMetaV.size();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue