Skip to content

Commit

Permalink
chore: init evicted job channels
Browse files Browse the repository at this point in the history
  • Loading branch information
yashmehrotra authored and moshloop committed Sep 23, 2024
1 parent 964874d commit 1f31cac
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions job/job.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
}
}

0 comments on commit 1f31cac

Please sign in to comment.