xueli.xue 9 年前
父节点
当前提交
73b6484dc9

+ 2 - 1
xxl-job-core/src/main/java/com/xxl/job/core/router/HandlerRouter.java 查看文件

@@ -40,7 +40,8 @@ public class HandlerRouter {
40 40
 		JobThread jobThread = new JobThread(handler);
41 41
 		jobThread.start();
42 42
 		logger.info(">>>>>>>>>>> xxl-job regist JobThread success, jobkey:{}, handler:{}", new Object[]{jobkey, handler});
43
-		return HandlerRouter.JobThreadRepository.put(jobkey, jobThread);	// putIfAbsent
43
+		HandlerRouter.JobThreadRepository.put(jobkey, jobThread);	// putIfAbsent | oh my god, map's put method return the old value!!!
44
+		return jobThread;
44 45
 	}
45 46
 	public static JobThread loadJobThread(String jobKey){
46 47
 		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 {
61 61
             }
62 62
         }
63 63
 
64
-        // sometime, cmap.get can not return given value, i do not know why
65
-        if (jobThread == null) {
66
-            jobThread = HandlerRouter.loadJobThread(jobKey);
67
-        }
68
-
69 64
         // push data to queue
70 65
         jobThread.pushTriggerQueue(requestModel);
71 66
         return new ResponseModel(ResponseModel.SUCCESS, null);