diff --git a/job/job.go b/job/job.go index 64d05bed..d357b27a 100644 --- a/job/job.go +++ b/job/job.go @@ -456,10 +456,7 @@ func (j *Job) GetPropertyInt(property string, def int) int { } func (j *Job) init() error { - if EvictedJobs == nil { - EvictedJobs = make(chan uuid.UUID, 1000) - go deleteEvictedJobs(j.Context) - } + StartJobHistoryEvictor(j.Context) if j.initialized { return nil @@ -637,3 +634,9 @@ func (j *Job) RemoveFromScheduler(cronRunner *cron.Cron) { } cronRunner.Remove(*j.entryID) } + +func init() { + if EvictedJobs == nil { + EvictedJobs = make(chan uuid.UUID, 1000) + } +}