From 1f31cacf16d08ce234803297c589bfc67eef72bf Mon Sep 17 00:00:00 2001 From: Yash Mehrotra Date: Mon, 23 Sep 2024 00:40:08 +0530 Subject: [PATCH] chore: init evicted job channels --- job/job.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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) + } +}