xueli.xue 9 anni fa
parent
commit
743fef2034

+ 9 - 1
xxl-job-admin/src/main/java/com/xxl/job/service/job/HttpJobBean.java Vedi File

@@ -8,6 +8,7 @@ import java.util.Map.Entry;
8 8
 import org.apache.commons.lang.StringUtils;
9 9
 import org.quartz.JobExecutionContext;
10 10
 import org.quartz.JobExecutionException;
11
+import org.quartz.impl.triggers.CronTriggerImpl;
11 12
 import org.slf4j.Logger;
12 13
 import org.slf4j.LoggerFactory;
13 14
 import org.springframework.scheduling.quartz.QuartzJobBean;
@@ -40,10 +41,17 @@ public class HttpJobBean extends QuartzJobBean {
40 41
 			}
41 42
 		}
42 43
 		
44
+		// corn
45
+		String cornExp = null;
46
+		if (context.getTrigger() instanceof CronTriggerImpl) {
47
+			CronTriggerImpl trigger = (CronTriggerImpl) context.getTrigger();
48
+			cornExp = trigger.getCronExpression();
49
+		}
50
+		
43 51
 		// save log
44 52
 		XxlJobLog jobLog = new XxlJobLog();
45 53
 		jobLog.setJobName(triggerKey);
46
-		jobLog.setJobCron(null);
54
+		jobLog.setJobCron(cornExp);
47 55
 		jobLog.setJobClass(HttpJobBean.class.getName());
48 56
 		jobLog.setJobData(JacksonUtil.writeValueAsString(params));
49 57
 		DynamicSchedulerUtil.xxlJobLogDao.save(jobLog);

+ 11 - 5
xxl-job-admin/src/main/webapp/static/js/joblog.index.1.js Vedi File

@@ -16,19 +16,25 @@ $(function() {
16 16
 	    "columns": [
17 17
 	                { "data": 'id', "bSortable": false, "visible" : false},
18 18
 	                { "data": 'jobName', "bSortable": false},
19
-	                { "data": 'jobCron', "bSortable": false},
20
-	                { "data": 'jobClass', "bSortable": false},
21
-	                { "data": 'jobData', "bSortable": false},
19
+	                { "data": 'jobCron', "bSortable": false, "visible" : false},
20
+	                { "data": 'jobClass', "bSortable": false, "visible" : false},
21
+	                { "data": 'jobData', "bSortable": false, "visible" : false},
22 22
 	                { 
23 23
 	                	"data": 'triggerTime', 
24 24
 	                	"bSortable": false, 
25 25
 	                	"render": function ( data, type, row ) {
26
-	                		return moment(new Date(data)).format("YYYY-MM-DD HH:mm:ss");
26
+	                		return data?moment(new Date(data)).format("YYYY-MM-DD HH:mm:ss"):"";
27 27
 	                	}
28 28
 	                },
29 29
 	                { "data": 'triggerStatus', "bSortable": false},
30 30
 	                { "data": 'triggerMsg',"bSortable": false},
31
-	                { "data": 'handleTime',"bSortable": false},
31
+	                { 
32
+	                	"data": 'handleTime',
33
+	                	"bSortable": false,
34
+	                	"render": function ( data, type, row ) {
35
+	                		return data?moment(new Date(data)).format("YYYY-MM-DD HH:mm:ss"):"";
36
+	                	}
37
+	                },
32 38
 	                { "data": 'handleStatus',"bSortable": false},
33 39
 	                { "data": 'handleMsg' , "bSortable": false}
34 40
 	            ],

+ 1 - 1
xxl-job-client/src/main/java/com/xxl/job/client/handler/HandlerRepository.java Vedi File

@@ -94,7 +94,7 @@ public class HandlerRepository {
94 94
 							new Object[]{handlerData, _status, _msg, callback_response, this});
95 95
 				} else {
96 96
 					try {
97
-						TimeUnit.SECONDS.sleep(1);
97
+						TimeUnit.MILLISECONDS.sleep(200);
98 98
 					} catch (InterruptedException e) {
99 99
 						e.printStackTrace();
100 100
 					}