From f368fb16ef67b6e1df4ab733c58bb9541239776f Mon Sep 17 00:00:00 2001 From: Claudio Cambra Date: Mon, 20 Jan 2025 17:56:52 +0800 Subject: [PATCH] Apply max concurrent chunk uploads retrieved from server capabilities Signed-off-by: Claudio Cambra --- src/gui/folder.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gui/folder.cpp b/src/gui/folder.cpp index 54a08ec2e8f54..d68a2196367f9 100644 --- a/src/gui/folder.cpp +++ b/src/gui/folder.cpp @@ -1151,7 +1151,11 @@ SyncOptions Folder::initializeSyncOptions() const opt._confirmExternalStorage = cfgFile.confirmExternalStorage(); opt._moveFilesToTrash = cfgFile.moveToTrash(); opt._vfs = _vfs; - opt._parallelNetworkJobs = account->isHttp2Supported() ? 20 : 6; + + const auto capsMaxConcurrentChunkUploads = account->capabilities().maxConcurrentChunkUploads(); + opt._parallelNetworkJobs = capsMaxConcurrentChunkUploads > 0 + ? capsMaxConcurrentChunkUploads + : account->isHttp2Supported() ? 20 : 6; // Chunk V2: Size of chunks must be between 5MB and 5GB, except for the last chunk which can be smaller const auto cfgMinChunkSize = cfgFile.minChunkSize();