diff --git a/src/libsync/propagateupload.cpp b/src/libsync/propagateupload.cpp index b723e95858617..1b2fe799c3d64 100644 --- a/src/libsync/propagateupload.cpp +++ b/src/libsync/propagateupload.cpp @@ -718,14 +718,12 @@ void PropagateUploadFileCommon::commonErrorHandling(AbstractNetworkJob *job) void PropagateUploadFileCommon::adjustLastJobTimeout(AbstractNetworkJob *job, qint64 fileSize) { + constexpr auto maximumTimeout = qint64(120 * 60 * 1000); constexpr double threeMinutes = 3.0 * 60 * 1000; - job->setTimeout(qBound( - job->timeoutMsec(), - // Calculate 3 minutes for each gigabyte of data - qRound64(threeMinutes * fileSize / 1e9), - // Maximum of 30 minutes - static_cast(30 * 60 * 1000))); + job->setTimeout(qBound(job->timeoutMsec(), + qRound64(threeMinutes * fileSize / 1e9) /*Calculate 3 minutes for each gigabyte of data*/, + maximumTimeout)); } void PropagateUploadFileCommon::slotJobDestroyed(QObject *job)