Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/desktop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Kamm <mail@ckamm.de>2018-02-20 19:28:54 +0300
committerCamila San <hello@camila.codes>2018-06-06 23:49:50 +0300
commit797b40237e2ef9b442b2e47e444e2fa8d051074d (patch)
treef421b2d4513956f462c663f664d8800fce5ae6c2 /src/gui/folder.cpp
parent448b0ebf63de46e64d48d221b3c4412d95be0d16 (diff)
Partial local discovery: Fix scheduling logic
A recent patch that touched the condition for deciding whether a periodic full local discovery is necessary accidentally inverted the condition.
Diffstat (limited to 'src/gui/folder.cpp')
-rw-r--r--src/gui/folder.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/gui/folder.cpp b/src/gui/folder.cpp
index 56f2b302d..01a3c7b84 100644
--- a/src/gui/folder.cpp
+++ b/src/gui/folder.cpp
@@ -643,9 +643,13 @@ void Folder::startSync(const QStringList &pathList)
}
return interval;
}();
- if (_folderWatcher && _folderWatcher->isReliable() && _timeSinceLastFullLocalDiscovery.isValid()
- && (fullLocalDiscoveryInterval.count() < 0
- || _timeSinceLastFullLocalDiscovery.hasExpired(fullLocalDiscoveryInterval.count()))) {
+ bool hasDoneFullLocalDiscovery = _timeSinceLastFullLocalDiscovery.isValid();
+ bool periodicFullLocalDiscoveryNow =
+ fullLocalDiscoveryInterval.count() >= 0 // negative means we don't require periodic full runs
+ && _timeSinceLastFullLocalDiscovery.hasExpired(fullLocalDiscoveryInterval.count());
+ if (_folderWatcher && _folderWatcher->isReliable()
+ && hasDoneFullLocalDiscovery
+ && !periodicFullLocalDiscoveryNow) {
qCInfo(lcFolder) << "Allowing local discovery to read from the database";
_engine->setLocalDiscoveryOptions(LocalDiscoveryStyle::DatabaseAndFilesystem, _localDiscoveryPaths);