xueli.xue 9 years ago
parent
commit
73b6484dc9

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

40
 		JobThread jobThread = new JobThread(handler);
40
 		JobThread jobThread = new JobThread(handler);
41
 		jobThread.start();
41
 		jobThread.start();
42
 		logger.info(">>>>>>>>>>> xxl-job regist JobThread success, jobkey:{}, handler:{}", new Object[]{jobkey, handler});
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
 	public static JobThread loadJobThread(String jobKey){
46
 	public static JobThread loadJobThread(String jobKey){
46
 		return HandlerRouter.JobThreadRepository.get(jobKey);
47
 		return HandlerRouter.JobThreadRepository.get(jobKey);

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

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
         // push data to queue
64
         // push data to queue
70
         jobThread.pushTriggerQueue(requestModel);
65
         jobThread.pushTriggerQueue(requestModel);
71
         return new ResponseModel(ResponseModel.SUCCESS, null);
66
         return new ResponseModel(ResponseModel.SUCCESS, null);