Glue(Shell) 等脚本任务支持失败重试;

pull/MERGE
xuxueli 7 years ago
parent ea5b3541e4
commit c48cb6eb25

@ -925,7 +925,7 @@ echo "分片总数 total = $3"
--- | --- | --- --- | --- | ---
成功 | IJobHandler.SUCCESS | 0 成功 | IJobHandler.SUCCESS | 0
失败 | IJobHandler.FAIL | -1其他 失败 | IJobHandler.FAIL | -1其他
失败重试 | IJobHandler.FAIL_RETRY | 501 失败重试 | IJobHandler.FAIL_RETRY | 101
## 六、版本更新日志 ## 六、版本更新日志

@ -45,7 +45,7 @@
SELECT <include refid="Base_Column_List" /> SELECT <include refid="Base_Column_List" />
FROM XXL_JOB_QRTZ_TRIGGER_LOG AS t FROM XXL_JOB_QRTZ_TRIGGER_LOG AS t
<trim prefix="WHERE" prefixOverrides="AND | OR" > <trim prefix="WHERE" prefixOverrides="AND | OR" >
<if test="jobGroup != null and jobGroup != ''"> <if test="jobGroup gt 0">
AND t.job_group = #{jobGroup} AND t.job_group = #{jobGroup}
</if> </if>
<if test="jobId gt 0"> <if test="jobId gt 0">
@ -62,12 +62,13 @@
</if> </if>
<if test="logStatus == 2" > <if test="logStatus == 2" >
AND ( AND (
(t.trigger_code <![CDATA[ > ]]> 0 AND t.trigger_code!=200) || t.trigger_code NOT IN (0, 200) ||
(t.handle_code <![CDATA[ > ]]> 0 AND t.handle_code!=200) t.handle_code NOT IN (0, 200)
) )
</if> </if>
<if test="logStatus == 3" > <if test="logStatus == 3" >
AND (t.trigger_code = 200 AND t.handle_code=0) AND t.trigger_code = 200
AND t.handle_code = 0
</if> </if>
</trim> </trim>
ORDER BY id DESC ORDER BY id DESC
@ -78,7 +79,7 @@
SELECT count(1) SELECT count(1)
FROM XXL_JOB_QRTZ_TRIGGER_LOG AS t FROM XXL_JOB_QRTZ_TRIGGER_LOG AS t
<trim prefix="WHERE" prefixOverrides="AND | OR" > <trim prefix="WHERE" prefixOverrides="AND | OR" >
<if test="jobGroup != null and jobGroup != ''"> <if test="jobGroup gt 0">
AND t.job_group = #{jobGroup} AND t.job_group = #{jobGroup}
</if> </if>
<if test="jobId gt 0"> <if test="jobId gt 0">
@ -95,12 +96,13 @@
</if> </if>
<if test="logStatus == 2" > <if test="logStatus == 2" >
AND ( AND (
(t.trigger_code <![CDATA[ > ]]> 0 AND t.trigger_code!=200) || t.trigger_code NOT IN (0, 200) ||
(t.handle_code <![CDATA[ > ]]> 0 AND t.handle_code!=200) t.handle_code NOT IN (0, 200)
) )
</if> </if>
<if test="logStatus == 3" > <if test="logStatus == 3" >
AND (t.trigger_code = 200 AND t.handle_code=0) AND t.trigger_code = 200
AND t.handle_code = 0
</if> </if>
</trim> </trim>
</select> </select>

@ -66,7 +66,7 @@ public class ScriptJobHandler extends IJobHandler {
if (exitValue == 0) { if (exitValue == 0) {
return IJobHandler.SUCCESS; return IJobHandler.SUCCESS;
} else if (exitValue == 501) { } else if (exitValue == 101) {
return IJobHandler.FAIL_RETRY; return IJobHandler.FAIL_RETRY;
} else { } else {
return new ReturnT<String>(IJobHandler.FAIL.getCode(), "script exit value("+exitValue+") is failed"); return new ReturnT<String>(IJobHandler.FAIL.getCode(), "script exit value("+exitValue+") is failed");

Loading…
Cancel
Save