From 0a244eb98170f731486e01c4d2b1c5d6afcb96f2 Mon Sep 17 00:00:00 2001 From: Laurent Clouet Date: Mon, 16 Dec 2024 13:48:04 +0100 Subject: [PATCH] Fix: if the chunk is already on the cache directory, no need to copy it from the shared directory --- src/main/java/com/sheepit/client/Client.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/sheepit/client/Client.java b/src/main/java/com/sheepit/client/Client.java index d33198a..36a8e55 100644 --- a/src/main/java/com/sheepit/client/Client.java +++ b/src/main/java/com/sheepit/client/Client.java @@ -873,7 +873,7 @@ import okhttp3.HttpUrl; // chunk files are already downloaded, either on shared directory or cache directory for (Chunk chunk: Utils.concatWithCollection(ajob.getRendererDownload().getChunks(), ajob.getProjectDownload().getChunks())) { - if (this.directoryManager.isSharedEnabled() && new File(this.directoryManager.getSharedPathFor(chunk)).exists()) { + if (new File(this.directoryManager.getCachePathFor(chunk)).exists() == false && this.directoryManager.isSharedEnabled() && new File(this.directoryManager.getSharedPathFor(chunk)).exists()) { this.gui.status("Copying chunk from common directory"); if (this.directoryManager.copyChunkFromSharedToCache(chunk) == false) { this.log.error("Error while copying " + this.directoryManager.getSharedPathFor(chunk) + " from shared downloads directory to working dir");