added missing time-stamping of keys

This commit is contained in:
csoler 2015-12-15 18:13:40 -05:00
parent 3617f9ced0
commit 0c4fd8e274

View File

@ -284,6 +284,8 @@ bool RsGxsIntegrityCheck::check()
std::cerr << " issuing random get on friends for non existing IDs" << std::endl; std::cerr << " issuing random get on friends for non existing IDs" << std::endl;
#endif #endif
// now request a cache update for them, which triggers downloading from friends, if missing.
for(;nb_requested_not_in_cache<MAX_GXS_IDS_REQUESTS_NET && gxs_ids.size()>0;) for(;nb_requested_not_in_cache<MAX_GXS_IDS_REQUESTS_NET && gxs_ids.size()>0;)
{ {
uint32_t n = RSRandom::random_u32() % gxs_ids.size() ; uint32_t n = RSRandom::random_u32() % gxs_ids.size() ;
@ -300,17 +302,26 @@ bool RsGxsIntegrityCheck::check()
std::cerr << " ... from cache/net" << std::endl; std::cerr << " ... from cache/net" << std::endl;
#endif #endif
} }
else else
{
#ifdef GXSUTIL_DEBUG
std::cerr << " ... already in cache" << std::endl; std::cerr << " ... already in cache" << std::endl;
#endif
// Note: we could time_stamp even in the case where the id is not cached. Anyway, it's not really a problem here, since IDs have a high chance of
// behing eventually stamped.
mGixs->timeStampKey(gxs_ids[n]) ;
}
gxs_ids[n] = gxs_ids[gxs_ids.size()-1] ; gxs_ids[n] = gxs_ids[gxs_ids.size()-1] ;
gxs_ids.pop_back() ; gxs_ids.pop_back() ;
} }
#ifdef GXSUTIL_DEBUG #ifdef GXSUTIL_DEBUG
std::cerr << " total actual cache requests: "<< nb_requested_not_in_cache << std::endl; std::cerr << " total actual cache requests: "<< nb_requested_not_in_cache << std::endl;
#endif #endif
return true; return true;
} }
bool RsGxsIntegrityCheck::isDone() bool RsGxsIntegrityCheck::isDone()