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