浏览代码

Skip root folder for two way sync

Signed-off-by: ZetaTom <70907959+ZetaTom@users.noreply.github.com>
ZetaTom 6 月之前
父节点
当前提交
398a851cb9
共有 1 个文件被更改,包括 7 次插入0 次删除
  1. 7 0
      app/src/main/java/com/nextcloud/client/jobs/InternalTwoWaySyncWork.kt

+ 7 - 0
app/src/main/java/com/nextcloud/client/jobs/InternalTwoWaySyncWork.kt

@@ -52,6 +52,13 @@ class InternalTwoWaySyncWork(
                     return checkFreeSpaceResult
                 }
 
+                // do not attempt to sync root folder
+                if (folder.remotePath == OCFile.ROOT_PATH) {
+                    folder.internalFolderSyncTimestamp = -1L
+                    fileDataStorageManager.saveFile(folder)
+                    continue
+                }
+
                 Log_OC.d(TAG, "Folder ${folder.remotePath}: started!")
                 val operation = SynchronizeFolderOperation(context, folder.remotePath, user, fileDataStorageManager)
                     .execute(context)