xueli.xue 9 лет назад
Родитель
Сommit
743fef2034

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

@@ -8,6 +8,7 @@ import java.util.Map.Entry;
 import org.apache.commons.lang.StringUtils;
 import org.quartz.JobExecutionContext;
 import org.quartz.JobExecutionException;
+import org.quartz.impl.triggers.CronTriggerImpl;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.scheduling.quartz.QuartzJobBean;
@@ -40,10 +41,17 @@ public class HttpJobBean extends QuartzJobBean {
 			}
 		}
 		
+		// corn
+		String cornExp = null;
+		if (context.getTrigger() instanceof CronTriggerImpl) {
+			CronTriggerImpl trigger = (CronTriggerImpl) context.getTrigger();
+			cornExp = trigger.getCronExpression();
+		}
+		
 		// save log
 		XxlJobLog jobLog = new XxlJobLog();
 		jobLog.setJobName(triggerKey);
-		jobLog.setJobCron(null);
+		jobLog.setJobCron(cornExp);
 		jobLog.setJobClass(HttpJobBean.class.getName());
 		jobLog.setJobData(JacksonUtil.writeValueAsString(params));
 		DynamicSchedulerUtil.xxlJobLogDao.save(jobLog);

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

@@ -16,19 +16,25 @@ $(function() {
 	    "columns": [
 	                { "data": 'id', "bSortable": false, "visible" : false},
 	                { "data": 'jobName', "bSortable": false},
-	                { "data": 'jobCron', "bSortable": false},
-	                { "data": 'jobClass', "bSortable": false},
-	                { "data": 'jobData', "bSortable": false},
+	                { "data": 'jobCron', "bSortable": false, "visible" : false},
+	                { "data": 'jobClass', "bSortable": false, "visible" : false},
+	                { "data": 'jobData', "bSortable": false, "visible" : false},
 	                { 
 	                	"data": 'triggerTime', 
 	                	"bSortable": false, 
 	                	"render": function ( data, type, row ) {
-	                		return moment(new Date(data)).format("YYYY-MM-DD HH:mm:ss");
+	                		return data?moment(new Date(data)).format("YYYY-MM-DD HH:mm:ss"):"";
 	                	}
 	                },
 	                { "data": 'triggerStatus', "bSortable": false},
 	                { "data": 'triggerMsg',"bSortable": false},
-	                { "data": 'handleTime',"bSortable": false},
+	                { 
+	                	"data": 'handleTime',
+	                	"bSortable": false,
+	                	"render": function ( data, type, row ) {
+	                		return data?moment(new Date(data)).format("YYYY-MM-DD HH:mm:ss"):"";
+	                	}
+	                },
 	                { "data": 'handleStatus',"bSortable": false},
 	                { "data": 'handleMsg' , "bSortable": false}
 	            ],

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

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