Skip to content

Commit

Permalink
use a longer maximum timeout during chunk uploads
Browse files Browse the repository at this point in the history
Close #5394

Signed-off-by: Matthieu Gallien <[email protected]>
  • Loading branch information
mgallien committed Mar 6, 2024
1 parent 3191603 commit 439e99b
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/libsync/propagateupload.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<qint64>(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)
Expand Down

0 comments on commit 439e99b

Please sign in to comment.