From 2976e743f5900012386065f2106ac6b83160a492 Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Sun, 4 Mar 2018 10:35:14 +0000 Subject: [PATCH] Retry initial sync forever (#234) --- include/ChatPage.h | 4 ---- src/ChatPage.cc | 14 -------------- 2 files changed, 18 deletions(-) diff --git a/include/ChatPage.h b/include/ChatPage.h index 5a6376c9..5cd1c623 100644 --- a/include/ChatPage.h +++ b/include/ChatPage.h @@ -194,10 +194,6 @@ private slots: // LMDB wrapper. QSharedPointer cache_; - - // If the number of failures exceeds a certain threshold we - // return to the login page. - int initialSyncFailures_ = 0; }; template diff --git a/src/ChatPage.cc b/src/ChatPage.cc index 0cb23651..93ae562e 100644 --- a/src/ChatPage.cc +++ b/src/ChatPage.cc @@ -42,7 +42,6 @@ #include "dialogs/ReadReceipts.h" #include "timeline/TimelineViewManager.h" -constexpr int MAX_INITIAL_SYNC_FAILURES = 7; constexpr int SYNC_RETRY_TIMEOUT = 40 * 1000; constexpr int INITIAL_SYNC_RETRY_TIMEOUT = 240 * 1000; @@ -975,19 +974,6 @@ ChatPage::retryInitialSync() return; } - initialSyncFailures_ += 1; - - if (initialSyncFailures_ >= MAX_INITIAL_SYNC_FAILURES) { - initialSyncFailures_ = 0; - - deleteConfigs(); - - emit showLoginPage( - tr("The client couldn't sync with the server. Please try again.")); - emit contentLoaded(); - return; - } - qWarning() << "Retrying initial sync"; client_->initialSync();