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