mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-22 21:15:55 +03:00
Make configurable the maximum amount of job in parallel
Bia the environement variable OWNCLOUD_MAX_PARALLEL
This commit is contained in:
parent
a1fc7f0a25
commit
3acdfc0004
1 changed files with 8 additions and 2 deletions
|
@ -25,7 +25,13 @@
|
|||
namespace Mirall {
|
||||
|
||||
/* The maximum number of active job in parallel */
|
||||
static const int maximumActiveJob = 3;
|
||||
static int maximumActiveJob() {
|
||||
static int max = qgetenv("OWNCLOUD_MAX_PARALLEL").toUInt();
|
||||
if (!max) {
|
||||
max = 3; //default
|
||||
}
|
||||
return max;
|
||||
}
|
||||
|
||||
void PropagateItemJob::done(SyncFileItem::Status status, const QString &errorString)
|
||||
{
|
||||
|
@ -288,7 +294,7 @@ void PropagateDirectory::slotSubJobReady()
|
|||
return; // Ignore the case when the _fistJob is ready and not yet finished
|
||||
if (_runningNow && _current >= 0 && _current < _subJobs.count()) {
|
||||
// there is a job running and the current one is not ready yet, we can't start new job
|
||||
if (!_subJobs[_current]->_readySent || _propagator->_activeJobs >= maximumActiveJob)
|
||||
if (!_subJobs[_current]->_readySent || _propagator->_activeJobs >= maximumActiveJob())
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue