[Pkg-owncloud-commits] [owncloud-client] 27/211: Sync scheduling: Never enqueue a folder while it is synced.

Sandro Knauß hefee-guest at moszumanska.debian.org
Sat Oct 25 09:10:22 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 3149cd03bede741953bde4f68c1f863358dbd5c0
Author: Christian Kamm <kamm at incasoftware.de>
Date:   Thu Oct 9 15:50:29 2014 +0200

    Sync scheduling: Never enqueue a folder while it is synced.
    
    Issues: #2268, #2275
---
 src/mirall/folderman.cpp | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/src/mirall/folderman.cpp b/src/mirall/folderman.cpp
index 6e7ad73..5c3a939 100644
--- a/src/mirall/folderman.cpp
+++ b/src/mirall/folderman.cpp
@@ -437,6 +437,16 @@ void FolderMan::slotScheduleAllFolders()
   */
 void FolderMan::slotScheduleSync( const QString& alias )
 {
+    // The folder watcher fires a lot of bogus notifications during
+    // a sync operation, both for actual user files and the database
+    // and log. Never enqueue a folder for sync while it is syncing.
+    // We lose some genuine sync requests that way, but that can't be
+    // helped.
+    if( _currentSyncFolder == alias ) {
+        qDebug() << "folder " << alias << " is currently syncing. NOT scheduling.";
+        return;
+    }
+
     if( alias.isEmpty() || ! _folderMap.contains(alias) ) {
         qDebug() << "Not scheduling sync for empty or unknown folder" << alias;
         return;
@@ -532,6 +542,8 @@ void FolderMan::slotFolderSyncStarted( )
 /*
   * a folder indicates that its syncing is finished.
   * Start the next sync after the system had some milliseconds to breath.
+  * This delay is particularly useful to avoid late file change notifications
+  * (that we caused ourselves by syncing) from triggering another spurious sync.
   */
 void FolderMan::slotFolderSyncFinished( const SyncResult& )
 {

-- 
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