diff --git a/src/libsync/owncloudpropagator.cpp b/src/libsync/owncloudpropagator.cpp index 83b067270..856b2e25f 100644 --- a/src/libsync/owncloudpropagator.cpp +++ b/src/libsync/owncloudpropagator.cpp @@ -487,6 +487,7 @@ void OwncloudPropagator::start(const SyncFileItemVector &items) connect(_rootJob.data(), &PropagatorJob::finished, this, &OwncloudPropagator::emitFinished); + _jobScheduled = false; scheduleNextJob(); } @@ -587,6 +588,8 @@ QString OwncloudPropagator::getFilePath(const QString &tmp_file_name) const void OwncloudPropagator::scheduleNextJob() { + if (_jobScheduled) return; // don't schedule more than 1 + _jobScheduled = true; QTimer::singleShot(0, this, &OwncloudPropagator::scheduleNextJobImpl); } @@ -597,6 +600,8 @@ void OwncloudPropagator::scheduleNextJobImpl() // Down-scaling on slow networks? https://github.com/owncloud/client/issues/3382 // Making sure we do up/down at same time? https://github.com/owncloud/client/issues/1633 + _jobScheduled = false; + if (_activeJobList.count() < maximumActiveTransferJob()) { if (_rootJob->scheduleSelfOrChild()) { scheduleNextJob(); diff --git a/src/libsync/owncloudpropagator.h b/src/libsync/owncloudpropagator.h index 0febc6ab7..c5431f051 100644 --- a/src/libsync/owncloudpropagator.h +++ b/src/libsync/owncloudpropagator.h @@ -567,6 +567,7 @@ private: AccountPtr _account; QScopedPointer _rootJob; SyncOptions _syncOptions; + bool _jobScheduled = false; };