MCPcopy Create free account
hub / github.com/PurpleI2P/i2pd / SaveProfiles

Function SaveProfiles

libi2pd/Profiling.cpp:337–348  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

335 }
336
337 void SaveProfiles ()
338 {
339 std::unordered_map<i2p::data::IdentHash, std::shared_ptr<RouterProfile> > tmp;
340 {
341 std::lock_guard<std::mutex> l(g_ProfilesMutex);
342 std::swap (tmp, g_Profiles);
343 }
344 auto ts = i2p::util::GetSecondsSinceEpoch ();
345 for (auto& it: tmp)
346 if (it.second->IsUseful() && (it.second->IsUpdated () || ts - it.second->GetLastUpdateTime () < PEER_PROFILE_EXPIRATION_TIMEOUT))
347 it.second->Save (it.first);
348 }
349
350 static void DeleteFilesFromDisk ()
351 {

Callers 1

StopMethod · 0.85

Calls 5

GetSecondsSinceEpochFunction · 0.85
IsUsefulMethod · 0.80
IsUpdatedMethod · 0.45
GetLastUpdateTimeMethod · 0.45
SaveMethod · 0.45

Tested by

no test coverage detected