[Pkg-owncloud-commits] [owncloud-client] 264/333: Make configurable the maximum amount of job in parallel

Sandro Knauß hefee-guest at moszumanska.debian.org
Thu Apr 17 23:17:02 UTC 2014


This is an automated email from the git hooks/post-receive script.

hefee-guest pushed a commit to branch master
in repository owncloud-client.

commit 3acdfc0004f91bf43dd681a745fa3cd40875c13e
Author: Olivier Goffart <ogoffart at woboq.com>
Date:   Fri Mar 28 11:20:07 2014 +0100

    Make configurable the maximum amount of job in parallel
    
    Bia the environement variable OWNCLOUD_MAX_PARALLEL
---
 src/mirall/owncloudpropagator.cpp | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/mirall/owncloudpropagator.cpp b/src/mirall/owncloudpropagator.cpp
index d0402d4..e8cb618 100644
--- a/src/mirall/owncloudpropagator.cpp
+++ b/src/mirall/owncloudpropagator.cpp
@@ -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;
     }
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git



More information about the Pkg-owncloud-commits mailing list