mirror of
https://github.com/go-gitea/gitea.git
synced 2024-05-11 05:55:29 +00: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 <[email protected]> Co-authored-by: Lunny Xiao <[email protected]> Co-authored-by: wxiaoguang <[email protected]>
This commit is contained in:
co-authored by
GitHub
Lunny Xiao
wxiaoguang
parent
9444135ff5
commit
4e57bd1d30
@@ -135,6 +135,13 @@ func (q *ByteFIFOQueue) IsEmpty() bool {
|
||||
return q.byteFIFO.Len(q.terminateCtx) == 0
|
||||
}
|
||||
|
||||
// NumberInQueue returns the number in the queue
|
||||
func (q *ByteFIFOQueue) NumberInQueue() int64 {
|
||||
q.lock.Lock()
|
||||
defer q.lock.Unlock()
|
||||
return q.byteFIFO.Len(q.terminateCtx) + q.WorkerPool.NumberInQueue()
|
||||
}
|
||||
|
||||
// Flush flushes the ByteFIFOQueue
|
||||
func (q *ByteFIFOQueue) Flush(timeout time.Duration) error {
|
||||
select {
|
||||
|
||||
Reference in New Issue
Block a user