V2.7 增加agent执行器

This commit is contained in:
georgehao
2019-07-03 22:31:27 +08:00
parent c3a89e9243
commit 37fb659c4e
48 changed files with 2832 additions and 513 deletions

View File

@@ -32,7 +32,7 @@ func AddJob(spec string, job *Job) bool {
lock.Lock()
defer lock.Unlock()
if GetEntryById(job.jobKey) != nil {
if GetEntryById(job.JobKey) != nil {
return false
}
err := mainCron.AddJob(spec, job)
@@ -47,7 +47,7 @@ func AddJob(spec string, job *Job) bool {
func RemoveJob(jobKey int) {
mainCron.RemoveJob(func(e *cron.Entry) bool {
if v, ok := e.Job.(*Job); ok {
if v.jobKey == jobKey {
if v.JobKey == jobKey {
return true
}
}
@@ -59,7 +59,7 @@ func GetEntryById(jobKey int) *cron.Entry {
entries := mainCron.Entries()
for _, e := range entries {
if v, ok := e.Job.(*Job); ok {
if v.jobKey == jobKey {
if v.JobKey == jobKey {
return e
}
}