[Pkg-owncloud-commits] [owncloud-client] 13/211: Sync scheduling: Improve logging. #2275

Sandro Knauß hefee-guest at moszumanska.debian.org
Sat Oct 25 09:10:21 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 886f9d82f2ef8a81ec0fe73bac1ce0a80ebcfea9
Author: Christian Kamm <kamm at incasoftware.de>
Date:   Thu Oct 9 09:01:35 2014 +0200

    Sync scheduling: Improve logging. #2275
---
 src/mirall/folder.cpp | 21 ++++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)

diff --git a/src/mirall/folder.cpp b/src/mirall/folder.cpp
index 5c5cdc1..4167e20 100644
--- a/src/mirall/folder.cpp
+++ b/src/mirall/folder.cpp
@@ -270,10 +270,24 @@ void Folder::slotPollTimerTimeout()
         return;
     }
 
-    if (quint64(_timeSinceLastSync.elapsed()) > MirallConfigFile().forceSyncInterval() ||
+    bool forceSyncIntervalExpired =
+            quint64(_timeSinceLastSync.elapsed()) > MirallConfigFile().forceSyncInterval();
+    bool okSyncResult =
+            _syncResult.status() == SyncResult::Success ||
+            _syncResult.status() == SyncResult::Problem;
+    if (forceSyncIntervalExpired ||
             _forceSyncOnPollTimeout ||
-            !(_syncResult.status() == SyncResult::Success ||_syncResult.status() == SyncResult::Problem)) {
-        qDebug() << "** Force Sync now, state is " << _syncResult.statusString();
+            !okSyncResult) {
+        if (forceSyncIntervalExpired) {
+            qDebug() << "** Force Sync, because it has been " << _timeSinceLastSync.elapsed() << "ms "
+                     << "since the last sync";
+        }
+        if (_forceSyncOnPollTimeout) {
+            qDebug() << "** Force Sync, because it was requested";
+        }
+        if (!okSyncResult) {
+            qDebug() << "** Force Sync, because the last sync had status: " << _syncResult.statusString();
+        }
         _forceSyncOnPollTimeout = false;
         emit scheduleToSync(alias());
     } else {
@@ -734,6 +748,7 @@ void Folder::slotSyncFinished()
         _timeSinceLastSync.restart();
     } else {
         // Another sync is required.  We will make sure that the poll timer occurs soon enough.
+        qDebug() << "another sync was requested by the finished sync";
         _forceSyncOnPollTimeout = true;
         QTimer::singleShot(1000, this, SLOT(slotPollTimerTimeout() ));
     }

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