| 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 | { |
no test coverage detected