Merge branch 'fix/copy' into 'master'

Fix: if the chunk is already on the cache directory, no need to copy it from the shared directory

See merge request sheepitrenderfarm/client!351
This commit is contained in:
Sheepit Renderfarm
2024-12-16 12:52:26 +00:00

View File

@@ -873,7 +873,7 @@ import okhttp3.HttpUrl;
// chunk files are already downloaded, either on shared directory or cache directory // chunk files are already downloaded, either on shared directory or cache directory
for (Chunk chunk: Utils.concatWithCollection(ajob.getRendererDownload().getChunks(), ajob.getProjectDownload().getChunks())) { 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"); this.gui.status("Copying chunk from common directory");
if (this.directoryManager.copyChunkFromSharedToCache(chunk) == false) { if (this.directoryManager.copyChunkFromSharedToCache(chunk) == false) {
this.log.error("Error while copying " + this.directoryManager.getSharedPathFor(chunk) + " from shared downloads directory to working dir"); this.log.error("Error while copying " + this.directoryManager.getSharedPathFor(chunk) + " from shared downloads directory to working dir");