Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use a longer maximum timeout during chunk uploads #6513

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions src/libsync/propagateupload.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*

Check notice on line 1 in src/libsync/propagateupload.cpp

View workflow job for this annotation

GitHub Actions / build

Run clang-format on src/libsync/propagateupload.cpp

File src/libsync/propagateupload.cpp does not conform to Custom style guidelines. (lines 724, 725)
* Copyright (C) by Olivier Goffart <[email protected]>
*
* This program is free software; you can redistribute it and/or modify
Expand All @@ -12,7 +12,7 @@
* for more details.
*/

#include "config.h"

Check failure on line 15 in src/libsync/propagateupload.cpp

View workflow job for this annotation

GitHub Actions / build

src/libsync/propagateupload.cpp:15:10 [clang-diagnostic-error]

'config.h' file not found
#include "propagateupload.h"
#include "propagateuploadencrypted.h"
#include "owncloudpropagator_p.h"
Expand Down Expand Up @@ -718,14 +718,12 @@

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
Loading