From b4ea476d999bd484345143fd7496eb93fde945c2 Mon Sep 17 00:00:00 2001 From: Chris Henson Date: Mon, 25 Sep 2017 17:02:33 -0400 Subject: [PATCH] 0003250 more efficient version of fix --- .../jumpmind/symmetric/io/stage/StagingManager.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/symmetric-io/src/main/java/org/jumpmind/symmetric/io/stage/StagingManager.java b/symmetric-io/src/main/java/org/jumpmind/symmetric/io/stage/StagingManager.java index 3ede9ebdf9..3ffedae65e 100644 --- a/symmetric-io/src/main/java/org/jumpmind/symmetric/io/stage/StagingManager.java +++ b/symmetric-io/src/main/java/org/jumpmind/symmetric/io/stage/StagingManager.java @@ -182,10 +182,15 @@ public IStagedResource find(String path) { if (resource == null) { boolean foundResourcePath = resourcePaths.contains(path); if (!foundResourcePath && clusterEnabled) { - refreshResourceList(); - foundResourcePath = resourcePaths.contains(path); - } - if (foundResourcePath) { + synchronized (this) { + StagedResource staged = new StagedResource(directory, path, this); + if (staged.exists() && staged.getState() == State.DONE) { + resourcePaths.add(path); + resource = staged; + foundResourcePath = true; + } + } + } else if (foundResourcePath) { resource = new StagedResource(directory, path, this); } }