From 3bf075b7c22156c0ad614c7487ba34a10aef9ee4 Mon Sep 17 00:00:00 2001 From: Manfred Karrer Date: Tue, 19 Jul 2016 18:44:48 +0200 Subject: [PATCH] Remove scanner as it conflicts when running seednode with nohup --- .../io/bitsquare/seednode/SeedNodeMain.java | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/seednode/src/main/java/io/bitsquare/seednode/SeedNodeMain.java b/seednode/src/main/java/io/bitsquare/seednode/SeedNodeMain.java index cafdf448d8..eaadf5d789 100644 --- a/seednode/src/main/java/io/bitsquare/seednode/SeedNodeMain.java +++ b/seednode/src/main/java/io/bitsquare/seednode/SeedNodeMain.java @@ -27,7 +27,6 @@ import joptsimple.OptionSet; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.util.Scanner; import java.util.concurrent.Executors; import java.util.concurrent.ThreadFactory; @@ -36,7 +35,6 @@ import static io.bitsquare.app.BitsquareEnvironment.*; public class SeedNodeMain extends BitsquareExecutable { private static final Logger log = LoggerFactory.getLogger(SeedNodeMain.class); private SeedNode seedNode; - private boolean isStopped; public static void main(String[] args) throws Exception { final ThreadFactory threadFactory = new ThreadFactoryBuilder() @@ -82,17 +80,12 @@ public class SeedNodeMain extends BitsquareExecutable { SeedNode.setEnvironment(new BitsquareEnvironment(options)); UserThread.execute(() -> seedNode = new SeedNode()); - while (!isStopped) { + while (true) { try { - Scanner scanner = new Scanner(System.in); - while (scanner.hasNextLine()) { - String inputString = scanner.nextLine(); - if (inputString.equals("q")) { - UserThread.execute(seedNode::shutDown); - isStopped = true; - } - } - } catch (Throwable ignore) { + Thread.sleep(Long.MAX_VALUE); + } catch (InterruptedException e) { + e.printStackTrace(); + log.error(e.getMessage()); } } }