diff options
Diffstat (limited to 'modules/queue/workerpool.go')
-rw-r--r-- | modules/queue/workerpool.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/modules/queue/workerpool.go b/modules/queue/workerpool.go index 100197c5e1..5f6ec18710 100644 --- a/modules/queue/workerpool.go +++ b/modules/queue/workerpool.go @@ -204,6 +204,11 @@ func (p *WorkerPool) NumberOfWorkers() int { return p.numberOfWorkers } +// NumberInQueue returns the number of items in the queue +func (p *WorkerPool) NumberInQueue() int64 { + return atomic.LoadInt64(&p.numInQueue) +} + // MaxNumberOfWorkers returns the maximum number of workers automatically added to the pool func (p *WorkerPool) MaxNumberOfWorkers() int { p.lock.Lock() |