Reduce debug noise .. and always close through runService
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-commandline/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-commandline/commit/97863327 Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-commandline/tree/97863327 Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-commandline/diff/97863327 Branch: refs/heads/master Commit: 9786332761b6b6b3bc6cf5c97a76d34b147e195f Parents: 9d2311e Author: Stian Soiland-Reyes <[email protected]> Authored: Thu May 26 16:17:51 2016 +0100 Committer: Stian Soiland-Reyes <[email protected]> Committed: Thu May 26 16:17:51 2016 +0100 ---------------------------------------------------------------------- .../apache/taverna/commandline/CommandLineTool.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-taverna-commandline/blob/97863327/taverna-commandline-common/src/main/java/org/apache/taverna/commandline/CommandLineTool.java ---------------------------------------------------------------------- diff --git a/taverna-commandline-common/src/main/java/org/apache/taverna/commandline/CommandLineTool.java b/taverna-commandline-common/src/main/java/org/apache/taverna/commandline/CommandLineTool.java index 1117a19..5133f21 100644 --- a/taverna-commandline-common/src/main/java/org/apache/taverna/commandline/CommandLineTool.java +++ b/taverna-commandline-common/src/main/java/org/apache/taverna/commandline/CommandLineTool.java @@ -292,12 +292,15 @@ public class CommandLineTool { Path bundlePath = Paths.get(commandLineOptions.saveResultsToBundle()); DataBundles.closeAndSaveBundle(runService.getDataBundle(runId), bundlePath); System.out.println("Workflow Run Bundle saved to: " + bundlePath.toAbsolutePath()); - } else { - System.out.println("Workflow Run Bundle: " + runService.getDataBundle(runId).getSource()); - // For debugging we'll leave it in /tmp for now - runService.getDataBundle(runId).setDeleteOnClose(false); - DataBundles.closeBundle(runService.getDataBundle(runId)); + } else { + // For debugging, set to false: + if (Boolean.getBoolean("debug.bundle")) { + System.out.println("Workflow Run Bundle: " + runService.getDataBundle(runId).getSource()); + } else { + runService.getDataBundle(runId).setDeleteOnClose(true); + } } + runService.close(runId); if (report.getState().equals(State.FAILED)) { System.out.println("Workflow failed - see report below.");
