Skip to content

Commit

Permalink
Merge pull request nextcloud#13897 from nextcloud/bugfix/unnecessary-…
Browse files Browse the repository at this point in the history
…sync

BugFix - Unnecessary Sync
  • Loading branch information
tobiasKaminsky authored Oct 30, 2024
2 parents 1fa3f72 + 6a8ca4d commit 2e03e22
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import java.util.Map;
import java.util.Vector;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.function.Consumer;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;

Expand Down Expand Up @@ -129,7 +130,6 @@ protected RemoteOperationResult run(OwnCloudClient client) {
if (result.isSuccess()) {
if (mRemoteFolderChanged) {
result = fetchAndSyncRemoteFolder(client);

} else {
prepareOpsFromLocalKnowledge();
}
Expand Down Expand Up @@ -419,7 +419,6 @@ private void prepareOpsFromLocalKnowledge() throws OperationCancelledException {
if (!child.isFolder()) {
if (!child.isDown()) {
mFilesForDirectDownload.add(child);

} else {
/// this should result in direct upload of files that were locally modified
SynchronizeFileOperation operation = new SynchronizeFileOperation(
Expand All @@ -431,7 +430,6 @@ private void prepareOpsFromLocalKnowledge() throws OperationCancelledException {
getStorageManager()
);
mFilesToSyncContents.add(operation);

}
}
}
Expand All @@ -442,9 +440,8 @@ private void syncContents() throws OperationCancelledException {
startContentSynchronizations(mFilesToSyncContents);
}


private void startDirectDownloads() {
FileDownloadHelper.Companion.instance().downloadFile(user, mLocalFolder);
mFilesForDirectDownload.forEach(file -> FileDownloadHelper.Companion.instance().downloadFile(user, file));
}

/**
Expand Down

0 comments on commit 2e03e22

Please sign in to comment.