fix refresh
Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/505b44a8 Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/505b44a8 Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/505b44a8 Branch: refs/heads/master Commit: 505b44a8cdf494a53de1c171d9a8becff79d0063 Parents: 298f0d8 Author: Shawn Feldman <[email protected]> Authored: Tue Oct 13 16:00:21 2015 -0600 Committer: Shawn Feldman <[email protected]> Committed: Tue Oct 13 16:00:21 2015 -0600 ---------------------------------------------------------------------- .../org/apache/usergrid/corepersistence/CpEntityManager.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/usergrid/blob/505b44a8/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManager.java ---------------------------------------------------------------------- diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManager.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManager.java index 4a13cd8..82bb6bb 100644 --- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManager.java +++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManager.java @@ -2885,6 +2885,8 @@ public class CpEntityManager implements EntityManager { map.put("some prop", "test"); boolean hasFinished = false; Entity refreshEntity = create("refresh", map); + IndexRefreshCommand.IndexRefreshCommandInfo indexRefreshCommandInfo + = managerCache.getEntityIndex(applicationScope).refreshAsync().toBlocking().first(); try { for (int i = 0; i < 10; i++) { if (searchCollection( @@ -2897,12 +2899,14 @@ public class CpEntityManager implements EntityManager { break; } Thread.sleep(250); - return managerCache.getEntityIndex(applicationScope).refreshAsync().toBlocking().first(); + } + if(!hasFinished){ + logger.warn("Did not find entity {} during refresh.",refreshEntity.getUuid()); } }finally { delete(refreshEntity); } - return new IndexRefreshCommand.IndexRefreshCommandInfo(hasFinished,System.currentTimeMillis() - start); + return indexRefreshCommandInfo; } catch (Exception e) { throw new RuntimeException("refresh failed",e); }
