fix: restore reconnect time

This commit is contained in:
NickVs2015
2026-04-02 10:26:16 +03:00
parent 646b1561f8
commit f6806459fd
3 changed files with 2 additions and 4 deletions

View File

@@ -27,7 +27,7 @@
#include "protocols/protocols_defs.h"
// How many times do we try to reconnect.
constexpr int MAX_CONNECTION_RETRY = 70;
constexpr int MAX_CONNECTION_RETRY = 10;
// How long do we wait between one try and the next one.
constexpr int CONNECTION_RETRY_TIMER_MSEC = 500;

View File

@@ -210,7 +210,6 @@ void LinuxNetworkWatcherWorker::NMStateChanged(quint32 state)
logger.debug() << "NMStateChanged " << state;
if (state == NM_STATE_ASLEEP) {
// Invalidate any in-flight gateway poll before emitting wakeup.
++m_pollGeneration;
emit wakeup();
} else if (state >= NM_STATE_CONNECTED_SITE && m_previousNMState < NM_STATE_CONNECTED_SITE) {
@@ -225,7 +224,7 @@ void LinuxNetworkWatcherWorker::NMStateChanged(quint32 state)
void LinuxNetworkWatcherWorker::checkGatewayAndEmit(int generation, int count) {
if (m_pollGeneration.load() != generation) {
return; // cancelled by a newer connect/disconnect event
return;
}
++count;

View File

@@ -44,7 +44,6 @@ class LinuxNetworkWatcherWorker final : public QObject {
// point is active and unsecure.
QStringList m_devicePaths;
quint32 m_previousNMState = 0;
// Incremented on every connect/disconnect event to cancel in-flight polls.
std::atomic<int> m_pollGeneration{0};
};