Skip to content

Commit 46c70a3

Browse files
committed
Allow disabling REST API
1 parent cc34f9b commit 46c70a3

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

convex-cli/src/main/java/convex/cli/peer/PeerStart.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ public void run() {
127127
if (controller==null) {
128128
paranoia("--address for peer controller not specified");
129129
log.debug("Controller address not specified.");
130-
131130
}
132131

133132
RESTServer restServer=null;;
@@ -137,9 +136,10 @@ public void run() {
137136
config.put(Keywords.STORE, store);
138137
Server server=API.launchPeer(config);
139138

140-
restServer=RESTServer.create(server);
141-
restServer.start(apiport);
142-
139+
if (!norest) {
140+
restServer=RESTServer.create(server);
141+
restServer.start(apiport);
142+
}
143143

144144
while (server.isRunning()&&!Thread.currentThread().isInterrupted()) {
145145
Thread.sleep(400);
@@ -149,6 +149,7 @@ public void run() {
149149
throw new CLIError(ExitCodes.CONFIG,"Error in peer configuration: "+t.getMessage(),t);
150150
} catch (InterruptedException e) {
151151
informWarning("Peer interrupted before normal shutdown");
152+
Thread.currentThread().interrupt();
152153
return;
153154
} finally {
154155
if (restServer!=null) restServer.stop();

0 commit comments

Comments
 (0)