Merge branch 'fix/log_spam_with_nohup' into 'master'
Fix client spamming logs if program is launched via nohup See merge request sheepitrenderfarm/client!115
This commit is contained in:
@@ -20,6 +20,7 @@
|
|||||||
package com.sheepit.client.standalone.text;
|
package com.sheepit.client.standalone.text;
|
||||||
|
|
||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
|
import java.io.IOException;
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -48,8 +49,10 @@ public class CLIInputObserver implements Runnable {
|
|||||||
try {
|
try {
|
||||||
line = in.readLine();
|
line = in.readLine();
|
||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (IOException e) {
|
||||||
// TODO: handle exception
|
// if the program has been launched into the background (e.g. with nohup), input is not valid
|
||||||
|
client.getLog().info("Unable to read user input, ignoring all further inputs");
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
for (CLIInputListener cliil : listeners)
|
for (CLIInputListener cliil : listeners)
|
||||||
cliil.commandEntered(client, line);
|
cliil.commandEntered(client, line);
|
||||||
@@ -59,7 +62,7 @@ public class CLIInputObserver implements Runnable {
|
|||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
// TODO: handle exception
|
// TODO: handle exception
|
||||||
}
|
client.getLog().error("FIXME: Unhandled exception while closing InputStreamReader(): " + e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user