// If not set, it is overwritten by the Application constructor with the value from the config
int AbstractNetworkJob::httpTimeout = qEnvironmentVariableIntValue("OWNCLOUD_TIMEOUT");
+bool AbstractNetworkJob::enableTimeout = false;
AbstractNetworkJob::AbstractNetworkJob(const AccountPtr &account, const QString &path, QObject *parent)
: QObject(parent)
ASSERT(account != parent);
_timer.setSingleShot(true);
- _timer.setTimerType(Qt::VeryCoarseTimer);
_timer.setInterval((httpTimeout ? httpTimeout : 300) * 1000); // default to 5 minutes.
connect(&_timer, &QTimer::timeout, this, &AbstractNetworkJob::slotTimeout);
void AbstractNetworkJob::slotTimeout()
{
+ // TODO: workaround, find cause of https://github.com/nextcloud/desktop/issues/7184
+ if (!AbstractNetworkJob::enableTimeout) {
+ return;
+ }
+
_timedout = true;
qCWarning(lcNetworkJob) << "Network job timeout" << (reply() ? reply()->request().url() : path());
onTimedOut();
explicit AbstractNetworkJob(const AccountPtr &account, const QString &path, QObject *parent = nullptr);
~AbstractNetworkJob() override;
+ static bool enableTimeout;
+
virtual void start();
[[nodiscard]] AccountPtr account() const { return _account; }