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

Method CleanUpCache

libi2pd_client/AddressBook.cpp:323–334  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

321 }
322
323 void AddressBookFilesystemStorage::CleanUpCache ()
324 {
325 auto ts = i2p::util::GetMonotonicSeconds ();
326 std::lock_guard<std::mutex> l(m_FullAddressCacheMutex);
327 for (auto it = m_FullAddressCache.begin (); it != m_FullAddressCache.end ();)
328 {
329 if (ts > it->second.second + ADDRESS_CACHE_EXPIRATION_TIMEOUT)
330 it = m_FullAddressCache.erase (it);
331 else
332 it++;
333 }
334 }
335
336//---------------------------------------------------------------------
337

Callers 1

ScheduleCacheUpdateMethod · 0.80

Calls 1

GetMonotonicSecondsFunction · 0.85

Tested by

no test coverage detected