improve logging of discovery policy decisions when scanning folders

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
This commit is contained in:
Matthieu Gallien 2022-11-17 09:42:47 +01:00
parent 686f78bebc
commit d36b2ee793
No known key found for this signature in database
GPG Key ID: 7D0F74F05C22F553
2 changed files with 14 additions and 1 deletions

View File

@ -32,11 +32,20 @@ class ExcludedFiles;
namespace OCC {
namespace LocalDiscoveryEnums {
OCSYNC_EXPORT Q_NAMESPACE
enum class LocalDiscoveryStyle {
FilesystemOnly, //< read all local data from the filesystem
DatabaseAndFilesystem, //< read from the db, except for listed paths
};
Q_ENUM_NS(LocalDiscoveryStyle)
}
using OCC::LocalDiscoveryEnums::LocalDiscoveryStyle;
class Account;
class SyncJournalDb;

View File

@ -586,7 +586,11 @@ void SyncEngine::startSync()
if (!_discoveryPhase->_remoteFolder.endsWith('/'))
_discoveryPhase->_remoteFolder+='/';
_discoveryPhase->_syncOptions = _syncOptions;
_discoveryPhase->_shouldDiscoverLocaly = [this](const QString &s) { return shouldDiscoverLocally(s); };
_discoveryPhase->_shouldDiscoverLocaly = [this](const QString &s) {
const auto result = shouldDiscoverLocally(s);
qCInfo(lcEngine) << "shouldDiscoverLocaly" << s << (result ? "true" : "false");
return result;
};
_discoveryPhase->setSelectiveSyncBlackList(selectiveSyncBlackList);
_discoveryPhase->setSelectiveSyncWhiteList(_journal->getSelectiveSyncList(SyncJournalDb::SelectiveSyncWhiteList, &ok));
if (!ok) {