Make "CanConnect" timeout configurable in watchdog

* see also https://swift-project.slack.com/archives/G7GD2UP9C/p1522624024000024
* added signatures
* changed timeout
This commit is contained in:
Klaus Basan
2018-04-02 19:32:48 +02:00
parent 9192d13a6c
commit 57b3760b61
4 changed files with 35 additions and 13 deletions

View File

@@ -79,6 +79,9 @@ namespace BlackCore
//! \threadsafe
int getCheckCount() const { return m_checkCount; }
//! Last URL used for ping /DB ping service)
QString getLastPingDbUrl() const;
//! Number of completed checks
//! \threadsafe
QString getCheckInfo() const;
@@ -119,6 +122,8 @@ namespace BlackCore
void changedInternetAccessibility(bool available);
private:
static constexpr int CanConnectTimeMs = 5000;
//! Do work, i.e. check connectivity
void doWork();
@@ -159,8 +164,9 @@ namespace BlackCore
std::atomic_int m_badCountInternet { 0 }; //! Total number of Internet failing count (only when network is accessible)
std::atomic_int m_goodCountDb { 0 };
std::atomic_int m_goodCountInternet { 0 };
QString m_lastPingUrl;
BlackMisc::Network::CUrl m_workingSharedUrl;
mutable QReadWriteLock m_lockSharedUrl;
mutable QReadWriteLock m_lockUrl;
};
} // ns
} // ns