aboutsummaryrefslogtreecommitdiff
path: root/lib/jobs/basejob.cpp
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2020-04-07 16:14:21 +0200
committerKitsune Ral <Kitsune-Ral@users.sf.net>2020-04-07 16:14:21 +0200
commit160b11bdfe32c9983fe5f34eafa783148b2decbe (patch)
treea3e4fdd1c0a459272561185a762ef8018392f5b0 /lib/jobs/basejob.cpp
parent254c971106b8cc5603caea123803a70bc4bf2e6e (diff)
downloadlibquotient-160b11bdfe32c9983fe5f34eafa783148b2decbe.tar.gz
libquotient-160b11bdfe32c9983fe5f34eafa783148b2decbe.zip
BaseJob: don't finish and re-try at the same time
Due to a missing return statement, a retry with auth case led to the job being finished and pending at the same time, with no good consequences.
Diffstat (limited to 'lib/jobs/basejob.cpp')
-rw-r--r--lib/jobs/basejob.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/jobs/basejob.cpp b/lib/jobs/basejob.cpp
index dfc3d3dd..7cddc343 100644
--- a/lib/jobs/basejob.cpp
+++ b/lib/jobs/basejob.cpp
@@ -527,6 +527,7 @@ void BaseJob::finishJob()
qCWarning(d->logCat) << this << "re-running with authentication";
emit retryScheduled(d->retriesTaken, 0);
d->connection->submit(this);
+ return;
}
if ((error() == NetworkError || error() == Timeout)
&& d->retriesTaken < d->maxRetries) {
@@ -542,6 +543,8 @@ void BaseJob::finishJob()
return;
}
+ Q_ASSERT(status().code != Pending);
+
// Notify those interested in any completion of the job including abandon()
emit finished(this);