Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
熊鹏飞
/
xxljob220
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
743fef20
authored
Dec 30, 2015
by
xueli.xue
Browse files
Options
_('Browse Files')
Download
Plain Diff
日志Log重构
parents
e26f94e4
c9fb9135
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
7 deletions
xxl-job-admin/src/main/java/com/xxl/job/service/job/HttpJobBean.java
xxl-job-admin/src/main/webapp/static/js/joblog.index.1.js
xxl-job-client/src/main/java/com/xxl/job/client/handler/HandlerRepository.java
xxl-job-admin/src/main/java/com/xxl/job/service/job/HttpJobBean.java
View file @
743fef20
...
@@ -8,6 +8,7 @@ import java.util.Map.Entry;
...
@@ -8,6 +8,7 @@ import java.util.Map.Entry;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.quartz.JobExecutionContext
;
import
org.quartz.JobExecutionContext
;
import
org.quartz.JobExecutionException
;
import
org.quartz.JobExecutionException
;
import
org.quartz.impl.triggers.CronTriggerImpl
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.scheduling.quartz.QuartzJobBean
;
import
org.springframework.scheduling.quartz.QuartzJobBean
;
...
@@ -40,10 +41,17 @@ public class HttpJobBean extends 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
// save log
XxlJobLog
jobLog
=
new
XxlJobLog
();
XxlJobLog
jobLog
=
new
XxlJobLog
();
jobLog
.
setJobName
(
triggerKey
);
jobLog
.
setJobName
(
triggerKey
);
jobLog
.
setJobCron
(
null
);
jobLog
.
setJobCron
(
cornExp
);
jobLog
.
setJobClass
(
HttpJobBean
.
class
.
getName
());
jobLog
.
setJobClass
(
HttpJobBean
.
class
.
getName
());
jobLog
.
setJobData
(
JacksonUtil
.
writeValueAsString
(
params
));
jobLog
.
setJobData
(
JacksonUtil
.
writeValueAsString
(
params
));
DynamicSchedulerUtil
.
xxlJobLogDao
.
save
(
jobLog
);
DynamicSchedulerUtil
.
xxlJobLogDao
.
save
(
jobLog
);
...
...
xxl-job-admin/src/main/webapp/static/js/joblog.index.1.js
View file @
743fef20
...
@@ -16,19 +16,25 @@ $(function() {
...
@@ -16,19 +16,25 @@ $(function() {
"columns"
:
[
"columns"
:
[
{
"data"
:
'id'
,
"bSortable"
:
false
,
"visible"
:
false
},
{
"data"
:
'id'
,
"bSortable"
:
false
,
"visible"
:
false
},
{
"data"
:
'jobName'
,
"bSortable"
:
false
},
{
"data"
:
'jobName'
,
"bSortable"
:
false
},
{
"data"
:
'jobCron'
,
"bSortable"
:
false
},
{
"data"
:
'jobCron'
,
"bSortable"
:
false
,
"visible"
:
false
},
{
"data"
:
'jobClass'
,
"bSortable"
:
false
},
{
"data"
:
'jobClass'
,
"bSortable"
:
false
,
"visible"
:
false
},
{
"data"
:
'jobData'
,
"bSortable"
:
false
},
{
"data"
:
'jobData'
,
"bSortable"
:
false
,
"visible"
:
false
},
{
{
"data"
:
'triggerTime'
,
"data"
:
'triggerTime'
,
"bSortable"
:
false
,
"bSortable"
:
false
,
"render"
:
function
(
data
,
type
,
row
)
{
"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"
:
'triggerStatus'
,
"bSortable"
:
false
},
{
"data"
:
'triggerMsg'
,
"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"
:
'handleStatus'
,
"bSortable"
:
false
},
{
"data"
:
'handleMsg'
,
"bSortable"
:
false
}
{
"data"
:
'handleMsg'
,
"bSortable"
:
false
}
],
],
...
...
xxl-job-client/src/main/java/com/xxl/job/client/handler/HandlerRepository.java
View file @
743fef20
...
@@ -94,7 +94,7 @@ public class HandlerRepository {
...
@@ -94,7 +94,7 @@ public class HandlerRepository {
new
Object
[]{
handlerData
,
_status
,
_msg
,
callback_response
,
this
});
new
Object
[]{
handlerData
,
_status
,
_msg
,
callback_response
,
this
});
}
else
{
}
else
{
try
{
try
{
TimeUnit
.
SECONDS
.
sleep
(
1
);
TimeUnit
.
MILLISECONDS
.
sleep
(
200
);
}
catch
(
InterruptedException
e
)
{
}
catch
(
InterruptedException
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment