removed double call to delete groups and delete msgs (left after previous changes). Improved output when checking groups/msgs

This commit is contained in:
csoler 2020-12-08 23:57:30 +01:00
parent ed5f8618b6
commit 4ddcf3c0bb

View file

@ -234,8 +234,7 @@ bool RsGxsIntegrityCheck::check(uint16_t service_type, RsGixs *mgixs, RsGeneralD
// compute hash and compare to stored value, if it fails then simply add it // compute hash and compare to stored value, if it fails then simply add it
// to list // to list
for( std::map<RsGxsGroupId, RsNxsGrp*>::iterator git = grp.begin(); for( std::map<RsGxsGroupId, RsNxsGrp*>::iterator git = grp.begin(); git != grp.end(); ++git )
git != grp.end(); ++git )
{ {
RsNxsGrp* grp = git->second; RsNxsGrp* grp = git->second;
RsFileHash currHash; RsFileHash currHash;
@ -311,6 +310,7 @@ bool RsGxsIntegrityCheck::check(uint16_t service_type, RsGixs *mgixs, RsGeneralD
} }
else else
{ {
std::cerr << __PRETTY_FUNCTION__ <<" (EE) deleting group " << grp->grpId << " with wrong hash or null/corrupted meta data. meta=" << grp->metaData << std::endl;
grpsToDel.push_back(grp->grpId); grpsToDel.push_back(grp->grpId);
#ifdef RS_DEEP_CHANNEL_INDEX #ifdef RS_DEEP_CHANNEL_INDEX
if(isGxsChannels) if(isGxsChannels)
@ -321,8 +321,6 @@ bool RsGxsIntegrityCheck::check(uint16_t service_type, RsGixs *mgixs, RsGeneralD
delete grp; delete grp;
} }
mds->removeGroups(grpsToDel);
// now messages // now messages
GxsMsgResult msgs; GxsMsgResult msgs;
@ -378,9 +376,7 @@ bool RsGxsIntegrityCheck::check(uint16_t service_type, RsGixs *mgixs, RsGeneralD
if(msg->metaData == NULL || currHash != msg->metaData->mHash) if(msg->metaData == NULL || currHash != msg->metaData->mHash)
{ {
std::cerr << __PRETTY_FUNCTION__ <<" (EE) deleting message data" std::cerr << __PRETTY_FUNCTION__ <<" (EE) deleting message " << msg->msgId << " in group " << msg->grpId << " with wrong hash or null/corrupted meta data. meta=" << (void*)msg->metaData << std::endl;
<< " with wrong hash or null meta data. meta="
<< (void*)msg->metaData << std::endl;
msgsToDel[msg->grpId].insert(msg->msgId); msgsToDel[msg->grpId].insert(msg->msgId);
#ifdef RS_DEEP_CHANNEL_INDEX #ifdef RS_DEEP_CHANNEL_INDEX
if(isGxsChannels) if(isGxsChannels)
@ -451,8 +447,6 @@ bool RsGxsIntegrityCheck::check(uint16_t service_type, RsGixs *mgixs, RsGeneralD
} }
} }
mds->removeMsgs(msgsToDel);
{ {
#ifdef DEBUG_GXSUTIL #ifdef DEBUG_GXSUTIL
GXSUTIL_DEBUG() << "At end of pass, this is the list used GXS ids: " << std::endl; GXSUTIL_DEBUG() << "At end of pass, this is the list used GXS ids: " << std::endl;