mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-31 21:28:11 +09:00 
			
		
		
		
	Add number in queue status to monitor page (#18712)
Add number in queue status to the monitor page so that administrators can assess how much work is left to be done in the queues. Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
		| @@ -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() | ||||
|   | ||||
		Reference in New Issue
	
	Block a user