xueli.xue 8 gadi atpakaļ
vecāks
revīzija
73b6484dc9

+ 2 - 1
xxl-job-core/src/main/java/com/xxl/job/core/router/HandlerRouter.java

@@ -40,7 +40,8 @@ public class HandlerRouter {
 		JobThread jobThread = new JobThread(handler);
 		jobThread.start();
 		logger.info(">>>>>>>>>>> xxl-job regist JobThread success, jobkey:{}, handler:{}", new Object[]{jobkey, handler});
-		return HandlerRouter.JobThreadRepository.put(jobkey, jobThread);	// putIfAbsent
+		HandlerRouter.JobThreadRepository.put(jobkey, jobThread);	// putIfAbsent | oh my god, map's put method return the old value!!!
+		return jobThread;
 	}
 	public static JobThread loadJobThread(String jobKey){
 		return HandlerRouter.JobThreadRepository.get(jobKey);

+ 0 - 5
xxl-job-core/src/main/java/com/xxl/job/core/router/action/RunAction.java

@@ -61,11 +61,6 @@ public class RunAction extends IAction {
             }
         }
 
-        // sometime, cmap.get can not return given value, i do not know why
-        if (jobThread == null) {
-            jobThread = HandlerRouter.loadJobThread(jobKey);
-        }
-
         // push data to queue
         jobThread.pushTriggerQueue(requestModel);
         return new ResponseModel(ResponseModel.SUCCESS, null);