Only calculate path with computeItemPath if path is empty (#2212)

* Only calculate path with computeItemPath if path is empty, avoiding a double calculation and DB operations
This commit is contained in:
abraunegg 2022-11-10 07:03:58 +11:00 committed by GitHub
parent c73c0aa608
commit 4a6c78a7a6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2406,7 +2406,10 @@ final class SyncEngine
// Is the item parent in the local database?
if (itemdb.idInLocalDatabase(item.driveId, item.parentId)){
// compute the item path to see if the path is excluded & need the full path for this file
path = computeItemPath(item.driveId, item.parentId) ~ "/" ~ item.name;
log.vdebug("sync_list item to check: ", path);
if (path.empty) {
path = computeItemPath(item.driveId, item.parentId) ~ "/" ~ item.name;
}
path = buildNormalizedPath(path);
if (selectiveSync.isPathExcludedViaSyncList(path)) {
// selective sync advised to skip, however is this a file and are we configured to upload / download files in the root?