Skip to content

Commit 360c753

Browse files
committed
use a longer maximum timeout during chunk uploads
Close #5394 Signed-off-by: Matthieu Gallien <[email protected]>
1 parent c0af76c commit 360c753

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/libsync/propagateupload.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -718,14 +718,12 @@ void PropagateUploadFileCommon::commonErrorHandling(AbstractNetworkJob *job)
718718

719719
void PropagateUploadFileCommon::adjustLastJobTimeout(AbstractNetworkJob *job, qint64 fileSize)
720720
{
721+
constexpr auto maximumTimeout = qint64(120 * 60 * 1000);
721722
constexpr double threeMinutes = 3.0 * 60 * 1000;
722723

723-
job->setTimeout(qBound(
724-
job->timeoutMsec(),
725-
// Calculate 3 minutes for each gigabyte of data
726-
qRound64(threeMinutes * fileSize / 1e9),
727-
// Maximum of 30 minutes
728-
static_cast<qint64>(30 * 60 * 1000)));
724+
job->setTimeout(qBound(job->timeoutMsec(),
725+
qRound64(threeMinutes * fileSize / 1e9) /*Calculate 3 minutes for each gigabyte of data*/,
726+
maximumTimeout));
729727
}
730728

731729
void PropagateUploadFileCommon::slotJobDestroyed(QObject *job)

0 commit comments

Comments
 (0)