mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-29 20:28:57 +03:00
Reduce timeout for some admin jobs
The oauth token jobs and the wizard redirect check job shouldn't have 5min timeouts.
This commit is contained in:
parent
1aa1e7f833
commit
78b082a23c
3 changed files with 6 additions and 0 deletions
|
@ -91,6 +91,7 @@ void OAuth::start()
|
|||
requestBody->setData(arguments.query(QUrl::FullyEncoded).toLatin1());
|
||||
|
||||
auto job = _account->sendRequest("POST", requestToken, req, requestBody);
|
||||
job->setTimeout(qMin(30 * 1000ll, job->timeoutMsec()));
|
||||
QObject::connect(job, &SimpleNetworkJob::finishedSignal, this, [this, socket](QNetworkReply *reply) {
|
||||
auto jsonData = reply->readAll();
|
||||
QJsonParseError jsonParseError;
|
||||
|
|
|
@ -180,6 +180,10 @@ void OwncloudSetupWizard::slotContinueDetermineAuth()
|
|||
// redirect subpaths.
|
||||
auto redirectCheckJob = account->sendRequest("GET", account->url());
|
||||
|
||||
// Use a significantly reduced timeout for this redirect check:
|
||||
// the 5-minute default is inappropriate.
|
||||
redirectCheckJob->setTimeout(qMin(2000ll, redirectCheckJob->timeoutMsec()));
|
||||
|
||||
// Grab the chain of permanent redirects and adjust the account url
|
||||
// accordingly
|
||||
auto permanentRedirects = std::make_shared<int>(0);
|
||||
|
|
|
@ -356,6 +356,7 @@ bool HttpCredentials::refreshAccessToken()
|
|||
requestBody->setData(arguments.query(QUrl::FullyEncoded).toLatin1());
|
||||
|
||||
auto job = _account->sendRequest("POST", requestToken, req, requestBody);
|
||||
job->setTimeout(qMin(30 * 1000ll, job->timeoutMsec()));
|
||||
QObject::connect(job, &SimpleNetworkJob::finishedSignal, this, [this](QNetworkReply *reply) {
|
||||
auto jsonData = reply->readAll();
|
||||
QJsonParseError jsonParseError;
|
||||
|
|
Loading…
Reference in a new issue