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:
Christian Kamm 2017-09-15 09:11:52 +02:00 committed by Roeland Jago Douma
parent 1aa1e7f833
commit 78b082a23c
No known key found for this signature in database
GPG key ID: F941078878347C0C
3 changed files with 6 additions and 0 deletions

View file

@ -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;

View file

@ -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);

View file

@ -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;