mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-25 06:25:56 +03:00
disable our code for network timeout
seems we have an issue with Windows and QTimer instances used to detect network timeout workaround, find cause of https://github.com/nextcloud/desktop/issues/7184 Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
This commit is contained in:
parent
abbbc29e5f
commit
14aef728b4
4 changed files with 12 additions and 1 deletions
|
@ -46,6 +46,7 @@ Q_LOGGING_CATEGORY(lcNetworkJob, "nextcloud.sync.networkjob", QtInfoMsg)
|
||||||
|
|
||||||
// If not set, it is overwritten by the Application constructor with the value from the config
|
// If not set, it is overwritten by the Application constructor with the value from the config
|
||||||
int AbstractNetworkJob::httpTimeout = qEnvironmentVariableIntValue("OWNCLOUD_TIMEOUT");
|
int AbstractNetworkJob::httpTimeout = qEnvironmentVariableIntValue("OWNCLOUD_TIMEOUT");
|
||||||
|
bool AbstractNetworkJob::enableTimeout = false;
|
||||||
|
|
||||||
AbstractNetworkJob::AbstractNetworkJob(const AccountPtr &account, const QString &path, QObject *parent)
|
AbstractNetworkJob::AbstractNetworkJob(const AccountPtr &account, const QString &path, QObject *parent)
|
||||||
: QObject(parent)
|
: QObject(parent)
|
||||||
|
@ -57,7 +58,6 @@ AbstractNetworkJob::AbstractNetworkJob(const AccountPtr &account, const QString
|
||||||
ASSERT(account != parent);
|
ASSERT(account != parent);
|
||||||
|
|
||||||
_timer.setSingleShot(true);
|
_timer.setSingleShot(true);
|
||||||
_timer.setTimerType(Qt::VeryCoarseTimer);
|
|
||||||
_timer.setInterval((httpTimeout ? httpTimeout : 300) * 1000); // default to 5 minutes.
|
_timer.setInterval((httpTimeout ? httpTimeout : 300) * 1000); // default to 5 minutes.
|
||||||
connect(&_timer, &QTimer::timeout, this, &AbstractNetworkJob::slotTimeout);
|
connect(&_timer, &QTimer::timeout, this, &AbstractNetworkJob::slotTimeout);
|
||||||
|
|
||||||
|
@ -367,6 +367,11 @@ void AbstractNetworkJob::start()
|
||||||
|
|
||||||
void AbstractNetworkJob::slotTimeout()
|
void AbstractNetworkJob::slotTimeout()
|
||||||
{
|
{
|
||||||
|
// TODO: workaround, find cause of https://github.com/nextcloud/desktop/issues/7184
|
||||||
|
if (!AbstractNetworkJob::enableTimeout) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
_timedout = true;
|
_timedout = true;
|
||||||
qCWarning(lcNetworkJob) << "Network job timeout" << (reply() ? reply()->request().url() : path());
|
qCWarning(lcNetworkJob) << "Network job timeout" << (reply() ? reply()->request().url() : path());
|
||||||
onTimedOut();
|
onTimedOut();
|
||||||
|
|
|
@ -45,6 +45,8 @@ public:
|
||||||
explicit AbstractNetworkJob(const AccountPtr &account, const QString &path, QObject *parent = nullptr);
|
explicit AbstractNetworkJob(const AccountPtr &account, const QString &path, QObject *parent = nullptr);
|
||||||
~AbstractNetworkJob() override;
|
~AbstractNetworkJob() override;
|
||||||
|
|
||||||
|
static bool enableTimeout;
|
||||||
|
|
||||||
virtual void start();
|
virtual void start();
|
||||||
|
|
||||||
[[nodiscard]] AccountPtr account() const { return _account; }
|
[[nodiscard]] AccountPtr account() const { return _account; }
|
||||||
|
|
|
@ -60,6 +60,8 @@ class TestChunkingNG : public QObject
|
||||||
private slots:
|
private slots:
|
||||||
void initTestCase()
|
void initTestCase()
|
||||||
{
|
{
|
||||||
|
AbstractNetworkJob::enableTimeout = true;
|
||||||
|
|
||||||
OCC::Logger::instance()->setLogFlush(true);
|
OCC::Logger::instance()->setLogFlush(true);
|
||||||
OCC::Logger::instance()->setLogDebug(true);
|
OCC::Logger::instance()->setLogDebug(true);
|
||||||
|
|
||||||
|
|
|
@ -50,6 +50,8 @@ class TestRemoteDiscovery : public QObject
|
||||||
private slots:
|
private slots:
|
||||||
void initTestCase()
|
void initTestCase()
|
||||||
{
|
{
|
||||||
|
AbstractNetworkJob::enableTimeout = true;
|
||||||
|
|
||||||
OCC::Logger::instance()->setLogFlush(true);
|
OCC::Logger::instance()->setLogFlush(true);
|
||||||
OCC::Logger::instance()->setLogDebug(true);
|
OCC::Logger::instance()->setLogDebug(true);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue