日志Log重构
This commit is contained in:
commit
743fef2034
|
@ -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);
|
||||
|
|
|
@ -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}
|
||||
],
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue