From 360c7533d5dbde2496f471b0bc71a6e4aac62533 Mon Sep 17 00:00:00 2001 From: Matthieu Gallien Date: Wed, 6 Mar 2024 11:24:37 +0100 Subject: [PATCH] use a longer maximum timeout during chunk uploads Close #5394 Signed-off-by: Matthieu Gallien --- src/libsync/propagateupload.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) 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)