fix XxlJobContext CODE spell error

master
zhengxin.ren 3 years ago
parent ff73b1a56d
commit 021daa0d76
  1. 2
      xxl-job-admin/src/main/java/com/xxl/job/admin/core/complete/XxlJobCompleter.java
  2. 2
      xxl-job-admin/src/test/java/com/xxl/job/adminbiz/AdminBizTest.java
  3. 8
      xxl-job-core/src/main/java/com/xxl/job/core/context/XxlJobContext.java
  4. 12
      xxl-job-core/src/main/java/com/xxl/job/core/context/XxlJobHelper.java
  5. 4
      xxl-job-core/src/main/java/com/xxl/job/core/thread/JobThread.java

@ -47,7 +47,7 @@ public class XxlJobCompleter {
// 1、handle success, to trigger child job // 1、handle success, to trigger child job
String triggerChildMsg = null; String triggerChildMsg = null;
if (XxlJobContext.HANDLE_COCE_SUCCESS == xxlJobLog.getHandleCode()) { if (XxlJobContext.HANDLE_CODE_SUCCESS == xxlJobLog.getHandleCode()) {
XxlJobInfo xxlJobInfo = XxlJobAdminConfig.getAdminConfig().getXxlJobInfoDao().loadById(xxlJobLog.getJobId()); XxlJobInfo xxlJobInfo = XxlJobAdminConfig.getAdminConfig().getXxlJobInfoDao().loadById(xxlJobLog.getJobId());
if (xxlJobInfo!=null && xxlJobInfo.getChildJobId()!=null && xxlJobInfo.getChildJobId().trim().length()>0) { if (xxlJobInfo!=null && xxlJobInfo.getChildJobId()!=null && xxlJobInfo.getChildJobId().trim().length()>0) {
triggerChildMsg = "<br><br><span style=\"color:#00c0ef;\" > >>>>>>>>>>>"+ I18nUtil.getString("jobconf_trigger_child_run") +"<<<<<<<<<<< </span><br>"; triggerChildMsg = "<br><br><span style=\"color:#00c0ef;\" > >>>>>>>>>>>"+ I18nUtil.getString("jobconf_trigger_child_run") +"<<<<<<<<<<< </span><br>";

@ -32,7 +32,7 @@ public class AdminBizTest {
HandleCallbackParam param = new HandleCallbackParam(); HandleCallbackParam param = new HandleCallbackParam();
param.setLogId(1); param.setLogId(1);
param.setHandleCode(XxlJobContext.HANDLE_COCE_SUCCESS); param.setHandleCode(XxlJobContext.HANDLE_CODE_SUCCESS);
List<HandleCallbackParam> callbackParamList = Arrays.asList(param); List<HandleCallbackParam> callbackParamList = Arrays.asList(param);

@ -8,9 +8,9 @@ package com.xxl.job.core.context;
*/ */
public class XxlJobContext { public class XxlJobContext {
public static final int HANDLE_COCE_SUCCESS = 200; public static final int HANDLE_CODE_SUCCESS = 200;
public static final int HANDLE_COCE_FAIL = 500; public static final int HANDLE_CODE_FAIL = 500;
public static final int HANDLE_COCE_TIMEOUT = 502; public static final int HANDLE_CODE_TIMEOUT = 502;
// ---------------------- base info ---------------------- // ---------------------- base info ----------------------
@ -68,7 +68,7 @@ public class XxlJobContext {
this.shardIndex = shardIndex; this.shardIndex = shardIndex;
this.shardTotal = shardTotal; this.shardTotal = shardTotal;
this.handleCode = HANDLE_COCE_SUCCESS; // default success this.handleCode = HANDLE_CODE_SUCCESS; // default success
} }
public long getJobId() { public long getJobId() {

@ -177,7 +177,7 @@ public class XxlJobHelper {
* @return * @return
*/ */
public static boolean handleSuccess(){ public static boolean handleSuccess(){
return handleResult(XxlJobContext.HANDLE_COCE_SUCCESS, null); return handleResult(XxlJobContext.HANDLE_CODE_SUCCESS, null);
} }
/** /**
@ -187,7 +187,7 @@ public class XxlJobHelper {
* @return * @return
*/ */
public static boolean handleSuccess(String handleMsg) { public static boolean handleSuccess(String handleMsg) {
return handleResult(XxlJobContext.HANDLE_COCE_SUCCESS, handleMsg); return handleResult(XxlJobContext.HANDLE_CODE_SUCCESS, handleMsg);
} }
/** /**
@ -196,7 +196,7 @@ public class XxlJobHelper {
* @return * @return
*/ */
public static boolean handleFail(){ public static boolean handleFail(){
return handleResult(XxlJobContext.HANDLE_COCE_FAIL, null); return handleResult(XxlJobContext.HANDLE_CODE_FAIL, null);
} }
/** /**
@ -206,7 +206,7 @@ public class XxlJobHelper {
* @return * @return
*/ */
public static boolean handleFail(String handleMsg) { public static boolean handleFail(String handleMsg) {
return handleResult(XxlJobContext.HANDLE_COCE_FAIL, handleMsg); return handleResult(XxlJobContext.HANDLE_CODE_FAIL, handleMsg);
} }
/** /**
@ -215,7 +215,7 @@ public class XxlJobHelper {
* @return * @return
*/ */
public static boolean handleTimeout(){ public static boolean handleTimeout(){
return handleResult(XxlJobContext.HANDLE_COCE_TIMEOUT, null); return handleResult(XxlJobContext.HANDLE_CODE_TIMEOUT, null);
} }
/** /**
@ -225,7 +225,7 @@ public class XxlJobHelper {
* @return * @return
*/ */
public static boolean handleTimeout(String handleMsg){ public static boolean handleTimeout(String handleMsg){
return handleResult(XxlJobContext.HANDLE_COCE_TIMEOUT, handleMsg); return handleResult(XxlJobContext.HANDLE_CODE_TIMEOUT, handleMsg);
} }
/** /**

@ -215,7 +215,7 @@ public class JobThread extends Thread{
TriggerCallbackThread.pushCallBack(new HandleCallbackParam( TriggerCallbackThread.pushCallBack(new HandleCallbackParam(
triggerParam.getLogId(), triggerParam.getLogId(),
triggerParam.getLogDateTime(), triggerParam.getLogDateTime(),
XxlJobContext.HANDLE_COCE_FAIL, XxlJobContext.HANDLE_CODE_FAIL,
stopReason + " [job running, killed]" ) stopReason + " [job running, killed]" )
); );
} }
@ -231,7 +231,7 @@ public class JobThread extends Thread{
TriggerCallbackThread.pushCallBack(new HandleCallbackParam( TriggerCallbackThread.pushCallBack(new HandleCallbackParam(
triggerParam.getLogId(), triggerParam.getLogId(),
triggerParam.getLogDateTime(), triggerParam.getLogDateTime(),
XxlJobContext.HANDLE_COCE_FAIL, XxlJobContext.HANDLE_CODE_FAIL,
stopReason + " [job not executed, in the job queue, killed.]") stopReason + " [job not executed, in the job queue, killed.]")
); );
} }

Loading…
Cancel
Save