From 928d076491b70ccca1bfffceca607e3eb3be382a Mon Sep 17 00:00:00 2001 From: Eugene R Date: Sat, 11 May 2024 14:42:20 +0300 Subject: [PATCH] feat(queue): export the job queue constructor (#134) --- quartz/queue.go | 4 ++-- quartz/scheduler.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/quartz/queue.go b/quartz/queue.go index fed5fa7..191d02a 100644 --- a/quartz/queue.go +++ b/quartz/queue.go @@ -137,8 +137,8 @@ type jobQueue struct { var _ JobQueue = (*jobQueue)(nil) -// newJobQueue initializes and returns an empty jobQueue. -func newJobQueue() *jobQueue { +// NewJobQueue initializes and returns an empty jobQueue. +func NewJobQueue() JobQueue { return &jobQueue{ delegate: priorityQueue{}, } diff --git a/quartz/scheduler.go b/quartz/scheduler.go index 41f38a6..560467e 100644 --- a/quartz/scheduler.go +++ b/quartz/scheduler.go @@ -149,7 +149,7 @@ func NewStdSchedulerWithOptions( jobQueueMtx sync.Locker, ) *StdScheduler { if jobQueue == nil { - jobQueue = newJobQueue() + jobQueue = NewJobQueue() } if jobQueueMtx == nil { jobQueueMtx = &sync.Mutex{}