From 17f12d83348193e9f4d5a807dfdb6c1dcce6a6d8 Mon Sep 17 00:00:00 2001 From: sithlord48 Date: Wed, 21 May 2025 21:01:36 -0400 Subject: [PATCH] chore: ClientApp remove unused restartRetryTimer and nextRetryTimer, use RETRY_TIME directly in ClientApp instead --- src/lib/deskflow/ClientApp.cpp | 34 +++------------------------------- src/lib/deskflow/ClientApp.h | 2 -- 2 files changed, 3 insertions(+), 33 deletions(-) diff --git a/src/lib/deskflow/ClientApp.cpp b/src/lib/deskflow/ClientApp.cpp index afc7a8d55..1902eb3e9 100644 --- a/src/lib/deskflow/ClientApp.cpp +++ b/src/lib/deskflow/ClientApp.cpp @@ -210,33 +210,6 @@ void ClientApp::updateStatus(const std::string &msg) const // do nothing } -void ClientApp::resetRestartTimeout() const -{ - // retry time can nolonger be changed - // s_retryTime = 0.0; -} - -double ClientApp::nextRestartTimeout() const -{ - // retry at a constant rate (Issue 52) - return RETRY_TIME; - - /* - // choose next restart timeout. we start with rapid retries - // then slow down. - if (s_retryTime < 1.0) { - s_retryTime = 1.0; - } - else if (s_retryTime < 3.0) { - s_retryTime = 3.0; - } - else { - s_retryTime = 5.0; - } - return s_retryTime; - */ -} - void ClientApp::handleScreenError(const Event &, void *) { LOG((CLOG_CRIT "error on screen")); @@ -285,7 +258,6 @@ void ClientApp::scheduleClientRestart(double retryTime) void ClientApp::handleClientConnected(const Event &, void *) { LOG((CLOG_NOTE "connected to server")); - resetRestartTimeout(); updateStatus(); } @@ -297,7 +269,7 @@ void ClientApp::handleClientFailed(const Event &e, void *) updateStatus(std::string("Failed to connect to server: ") + info->m_what + " Trying next address..."); LOG((CLOG_WARN "failed to connect to server=%s, trying next address", info->m_what.c_str())); if (!m_suspended) { - scheduleClientRestart(nextRestartTimeout()); + scheduleClientRestart(RETRY_TIME); } } else { m_lastServerAddressIndex = 0; @@ -316,7 +288,7 @@ void ClientApp::handleClientRefused(const Event &e, void *) } else { LOG((CLOG_WARN "failed to connect to server: %s", info->m_what.c_str())); if (!m_suspended) { - scheduleClientRestart(nextRestartTimeout()); + scheduleClientRestart(RETRY_TIME); } } } @@ -327,7 +299,7 @@ void ClientApp::handleClientDisconnected(const Event &, void *) if (!args().m_restartable) { m_events->addEvent(Event(EventTypes::Quit)); } else if (!m_suspended) { - scheduleClientRestart(nextRestartTimeout()); + scheduleClientRestart(RETRY_TIME); } updateStatus(); } diff --git a/src/lib/deskflow/ClientApp.h b/src/lib/deskflow/ClientApp.h index 0adb0075b..e38d82562 100644 --- a/src/lib/deskflow/ClientApp.h +++ b/src/lib/deskflow/ClientApp.h @@ -64,8 +64,6 @@ public: void updateStatus(); void updateStatus(const std::string &msg) const; - void resetRestartTimeout() const; - double nextRestartTimeout() const; void handleScreenError(const Event &, void *); deskflow::Screen *openClientScreen(); void closeClientScreen(deskflow::Screen *screen);