mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-02-13 00:07:39 +01:00
try subscriptions right after initial download
This commit is contained in:
parent
6840259734
commit
94806ad0b3
1 changed files with 8 additions and 5 deletions
|
@ -340,15 +340,18 @@ namespace client
|
||||||
void AddressBook::DownloadComplete (bool success)
|
void AddressBook::DownloadComplete (bool success)
|
||||||
{
|
{
|
||||||
m_IsDownloading = false;
|
m_IsDownloading = false;
|
||||||
if (success && m_DefaultSubscription)
|
int nextUpdateTimeout = CONTINIOUS_SUBSCRIPTION_RETRY_TIMEOUT;
|
||||||
|
if (success)
|
||||||
{
|
{
|
||||||
m_DefaultSubscription.reset (nullptr);
|
if (m_DefaultSubscription) m_DefaultSubscription.reset (nullptr);
|
||||||
m_IsLoaded = true;
|
if (m_IsLoaded)
|
||||||
|
nextUpdateTimeout = CONTINIOUS_SUBSCRIPTION_UPDATE_TIMEOUT;
|
||||||
|
else
|
||||||
|
m_IsLoaded = true;
|
||||||
}
|
}
|
||||||
if (m_SubscriptionsUpdateTimer)
|
if (m_SubscriptionsUpdateTimer)
|
||||||
{
|
{
|
||||||
m_SubscriptionsUpdateTimer->expires_from_now (boost::posix_time::minutes(
|
m_SubscriptionsUpdateTimer->expires_from_now (boost::posix_time::minutes(nextUpdateTimeout));
|
||||||
success ? CONTINIOUS_SUBSCRIPTION_UPDATE_TIMEOUT : CONTINIOUS_SUBSCRIPTION_RETRY_TIMEOUT));
|
|
||||||
m_SubscriptionsUpdateTimer->async_wait (std::bind (&AddressBook::HandleSubscriptionsUpdateTimer,
|
m_SubscriptionsUpdateTimer->async_wait (std::bind (&AddressBook::HandleSubscriptionsUpdateTimer,
|
||||||
this, std::placeholders::_1));
|
this, std::placeholders::_1));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue