mirror of
https://github.com/corda/corda.git
synced 2025-04-07 19:34:41 +00:00
[CORDA-1569]: Shell doesn't yield control back to the user after a completed flow and throws NullPointerExceptions (#3281)
* [CORDA-1569]: Shell doesn't yield control back to the user after a completed flow and throws NullPointerExceptions
This commit is contained in:
parent
51c359c48d
commit
52fa86079b
@ -36,7 +36,7 @@ public class FlowShellCommand extends InteractiveShellCommand {
|
||||
@Usage("The class name of the flow to run, or an unambiguous substring") @Argument String name,
|
||||
@Usage("The data to pass as input") @Argument(unquote = false) List<String> input
|
||||
) {
|
||||
logger.info("Executing command \"flow start {} {}\",", name, input.stream().collect(joining(" ")));
|
||||
logger.info("Executing command \"flow start {} {}\",", name, (input != null) ? input.stream().collect(joining(" ")) : "<no arguments>");
|
||||
startFlow(name, input, out, ops(), ansiProgressRenderer(), objectMapper());
|
||||
}
|
||||
|
||||
|
@ -37,7 +37,7 @@ public class RunShellCommand extends InteractiveShellCommand {
|
||||
)
|
||||
@Usage("runs a method from the CordaRPCOps interface on the node.")
|
||||
public Object main(InvocationContext<Map> context, @Usage("The command to run") @Argument(unquote = false) List<String> command) {
|
||||
logger.info("Executing command \"run {}\",", command.stream().collect(joining(" ")));
|
||||
logger.info("Executing command \"run {}\",", (command != null) ? command.stream().collect(joining(" ")) : "<no arguments>");
|
||||
StringToMethodCallParser<CordaRPCOps> parser = new StringToMethodCallParser<>(CordaRPCOps.class, objectMapper());
|
||||
|
||||
if (command == null) {
|
||||
|
@ -21,7 +21,7 @@ public class StartShellCommand extends InteractiveShellCommand {
|
||||
public void main(@Usage("The class name of the flow to run, or an unambiguous substring") @Argument String name,
|
||||
@Usage("The data to pass as input") @Argument(unquote = false) List<String> input) {
|
||||
|
||||
logger.info("Executing command \"start {} {}\",", name, input.stream().collect(joining(" ")));
|
||||
logger.info("Executing command \"start {} {}\",", name, (input != null) ? input.stream().collect(joining(" ")) : "<no arguments>");
|
||||
ANSIProgressRenderer ansiProgressRenderer = ansiProgressRenderer();
|
||||
FlowShellCommand.startFlow(name, input, out, ops(), ansiProgressRenderer != null ? ansiProgressRenderer : new CRaSHANSIProgressRenderer(out), objectMapper());
|
||||
}
|
||||
|
@ -281,6 +281,7 @@ object InteractiveShell {
|
||||
while (!Thread.currentThread().isInterrupted) {
|
||||
try {
|
||||
latch.await()
|
||||
break
|
||||
} catch (e: InterruptedException) {
|
||||
try {
|
||||
rpcOps.killFlow(stateObservable.id)
|
||||
|
Loading…
x
Reference in New Issue
Block a user