From 1c396711eda411cfe48c61dcfbdf6df88d400b58 Mon Sep 17 00:00:00 2001 From: Zlatin Balevsky Date: Sat, 2 Nov 2019 11:15:08 +0000 Subject: [PATCH] Fix sidecar files larger than the limit from being shared --- .../main/groovy/com/muwire/core/files/HasherService.groovy | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/core/src/main/groovy/com/muwire/core/files/HasherService.groovy b/core/src/main/groovy/com/muwire/core/files/HasherService.groovy index 50b7b393..f9aff41e 100644 --- a/core/src/main/groovy/com/muwire/core/files/HasherService.groovy +++ b/core/src/main/groovy/com/muwire/core/files/HasherService.groovy @@ -36,9 +36,10 @@ class HasherService { return if (canonical.isFile() && fileManager.negativeTree.fileToNode.containsKey(canonical)) return - if (canonical.getName().endsWith(".mwcomment") && canonical.length() <= Constants.MAX_COMMENT_LENGTH) - eventBus.publish(new SideCarFileEvent(file : canonical)) - else if (hashed.add(canonical)) + if (canonical.getName().endsWith(".mwcomment")) { + if (canonical.length() <= Constants.MAX_COMMENT_LENGTH) + eventBus.publish(new SideCarFileEvent(file : canonical)) + } else if (hashed.add(canonical)) executor.execute( { -> process(canonical) } as Runnable) }