| 899 | } |
| 900 | |
| 901 | void AddressBook::ScheduleCacheUpdate () |
| 902 | { |
| 903 | if (!m_AddressCacheUpdateTimer) |
| 904 | { |
| 905 | auto dest = i2p::client::context.GetSharedLocalDestination (); |
| 906 | if(dest) |
| 907 | m_AddressCacheUpdateTimer = std::make_unique<boost::asio::steady_timer>(dest->GetService ()); |
| 908 | } |
| 909 | if (m_AddressCacheUpdateTimer) |
| 910 | { |
| 911 | m_AddressCacheUpdateTimer->expires_after (std::chrono::seconds(ADDRESS_CACHE_UPDATE_INTERVAL )); |
| 912 | m_AddressCacheUpdateTimer->async_wait ( |
| 913 | [this](const boost::system::error_code& ecode) |
| 914 | { |
| 915 | if (ecode != boost::asio::error::operation_aborted) |
| 916 | { |
| 917 | if (m_Storage) m_Storage->CleanUpCache (); |
| 918 | ScheduleCacheUpdate (); |
| 919 | } |
| 920 | }); |
| 921 | } |
| 922 | } |
| 923 | |
| 924 | AddressBookSubscription::AddressBookSubscription (AddressBook& book, std::string_view link): |
| 925 | m_Book (book), m_Link (link) |
nothing calls this directly
no test coverage detected