diff --git a/convex-cli/src/main/java/convex/cli/peer/PeerStart.java b/convex-cli/src/main/java/convex/cli/peer/PeerStart.java index c4cdb827f..8366f4124 100644 --- a/convex-cli/src/main/java/convex/cli/peer/PeerStart.java +++ b/convex-cli/src/main/java/convex/cli/peer/PeerStart.java @@ -127,7 +127,6 @@ public void run() { if (controller==null) { paranoia("--address for peer controller not specified"); log.debug("Controller address not specified."); - } RESTServer restServer=null;; @@ -137,9 +136,10 @@ public void run() { config.put(Keywords.STORE, store); Server server=API.launchPeer(config); - restServer=RESTServer.create(server); - restServer.start(apiport); - + if (!norest) { + restServer=RESTServer.create(server); + restServer.start(apiport); + } while (server.isRunning()&&!Thread.currentThread().isInterrupted()) { Thread.sleep(400); @@ -149,6 +149,7 @@ public void run() { throw new CLIError(ExitCodes.CONFIG,"Error in peer configuration: "+t.getMessage(),t); } catch (InterruptedException e) { informWarning("Peer interrupted before normal shutdown"); + Thread.currentThread().interrupt(); return; } finally { if (restServer!=null) restServer.stop();