Skip to content

Commit

Permalink
Merge pull request #403 from nextcloud/upstream/pr/6372
Browse files Browse the repository at this point in the history
Partial local discovery: Fix scheduling logic
  • Loading branch information
rullzer authored Oct 30, 2018
2 parents 326c872 + 8df9746 commit aca75ee
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/gui/folder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -645,9 +645,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);

Expand Down

0 comments on commit aca75ee

Please sign in to comment.