Skip to content

Commit

Permalink
make the Sync more user-friendly
Browse files Browse the repository at this point in the history
  • Loading branch information
maoling committed May 21, 2019
1 parent a3ce170 commit 95123c0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Expand Up @@ -71,7 +71,11 @@ public void processResult(int rc, String path, Object ctx) {
}, null);

int resultCode = cf.get(SYNC_TIMEOUT, TimeUnit.MILLISECONDS);
out.println("Sync returned " + resultCode);
if(resultCode == 0) {
out.println("Sync is OK");
} else {
out.println("Sync has failed");
}
} catch (IllegalArgumentException ex) {
throw new MalformedPathException(ex.getMessage());
} catch (InterruptedException ie) {
Expand Down
Expand Up @@ -626,7 +626,7 @@ public void testSyncCommand() throws Exception {
cmd.setZk(zk);
cmd.parse("sync /".split(" "));
List<String> expected = new ArrayList<String>();
expected.add("Sync returned 0");
expected.add("Sync is OK");

runCommandExpect(cmd, expected);
}
Expand Down

0 comments on commit 95123c0

Please sign in to comment.