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

Function DeleteObsoleteProfiles

libi2pd/Profiling.cpp:372–387  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

370 }
371
372 std::future<void> DeleteObsoleteProfiles ()
373 {
374 {
375 auto ts = i2p::util::GetSecondsSinceEpoch ();
376 std::lock_guard<std::mutex> l(g_ProfilesMutex);
377 for (auto it = g_Profiles.begin (); it != g_Profiles.end ();)
378 {
379 if (ts - it->second->GetLastUpdateTime () >= PEER_PROFILE_EXPIRATION_TIMEOUT)
380 it = g_Profiles.erase (it);
381 else
382 it++;
383 }
384 }
385
386 return std::async (std::launch::async, DeleteFilesFromDisk);
387 }
388
389 bool UpdateRouterProfile (const IdentHash& identHash, std::function<void (std::shared_ptr<RouterProfile>)> update)
390 {

Callers 2

StopMethod · 0.85
RunMethod · 0.85

Calls 2

GetSecondsSinceEpochFunction · 0.85
GetLastUpdateTimeMethod · 0.45

Tested by

no test coverage detected