From 78b8eeb4929132792172a707caeb8c0211d48784 Mon Sep 17 00:00:00 2001 From: "xueli.xue" Date: Thu, 29 Oct 2020 15:41:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=A7=E8=A1=8C=E5=99=A8Commandhandler?= =?UTF-8?q?=E7=A4=BA=E4=BE=8B=E4=BB=BB=E5=8A=A1=E4=BC=98=E5=8C=96=EF=BC=8C?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=9E=81=E7=AB=AF=E6=83=85=E5=86=B5=E4=B8=8B?= =?UTF-8?q?=E8=84=9A=E6=9C=AC=E8=BF=9B=E7=A8=8B=E6=8C=82=E8=B5=B7=E9=97=AE?= =?UTF-8?q?=E9=A2=98=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/XXL-JOB官方文档.md | 4 +++- .../xxl/job/executor/service/jobhandler/SampleXxlJob.java | 8 +++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/doc/XXL-JOB官方文档.md b/doc/XXL-JOB官方文档.md index 7f199a2c..55f6dc44 100644 --- a/doc/XXL-JOB官方文档.md +++ b/doc/XXL-JOB官方文档.md @@ -2061,8 +2061,10 @@ data: post-data - 15、调度通讯组件优化,修复RestFul方式调用 DotNet 版本执行器时心跳检测失败问题; - 16、调度中心组件加载顺序优化,修复极端情况下调度组件初始慢导致的调度失败问题; - 17、执行器注册线程优化,修复极端情况下初始化失败时导致NPE问题; -- 18、[规划中]任务触发参数优化:支持选择 "Cron触发"、"固定间隔时间触发"、"指定时间点触发"、"不选择" 等; +- 18、执行器Commandhandler示例任务优化,修复极端情况下脚本进程挂起问题; - 19、[规划中]分片任务:全部完成后才会出发后置节点; +- 20、[规划中]执行器注册,异步写入; +- 21、[规划中]任务触发参数优化:支持选择 "Cron触发"、"固定间隔时间触发"、"指定时间点触发"、"不选择" 等; ### 7.32 版本 v2.3.0 Release Notes[规划中] - 1、[规划中]DAG流程任务 diff --git a/xxl-job-executor-samples/xxl-job-executor-sample-springboot/src/main/java/com/xxl/job/executor/service/jobhandler/SampleXxlJob.java b/xxl-job-executor-samples/xxl-job-executor-sample-springboot/src/main/java/com/xxl/job/executor/service/jobhandler/SampleXxlJob.java index fac84edf..80ae6db5 100644 --- a/xxl-job-executor-samples/xxl-job-executor-sample-springboot/src/main/java/com/xxl/job/executor/service/jobhandler/SampleXxlJob.java +++ b/xxl-job-executor-samples/xxl-job-executor-sample-springboot/src/main/java/com/xxl/job/executor/service/jobhandler/SampleXxlJob.java @@ -84,7 +84,13 @@ public class SampleXxlJob { BufferedReader bufferedReader = null; try { // command process - Process process = Runtime.getRuntime().exec(command); + ProcessBuilder processBuilder = new ProcessBuilder(); + processBuilder.command(command); + processBuilder.redirectErrorStream(true); + + Process process = processBuilder.start(); + //Process process = Runtime.getRuntime().exec(command); + BufferedInputStream bufferedInputStream = new BufferedInputStream(process.getInputStream()); bufferedReader = new BufferedReader(new InputStreamReader(bufferedInputStream));