Skip to content
This repository was archived by the owner on Feb 16, 2025. It is now read-only.

Commit 0c31b87

Browse files
committed
fix a panic
1 parent 3ad2369 commit 0c31b87

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

app/queue/honest_priority_queue.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ func (hjq *HonestJobQueue) Pop() *Job {
7474
hjq.mu.Lock()
7575
defer hjq.mu.Unlock()
7676

77+
if hjq.queue.Len() == 0 {
78+
return nil
79+
}
7780
job := heap.Pop(&hjq.queue).(*Job)
7881

7982
for _, ok := hjq.banned[job.userID]; ok; {

0 commit comments

Comments
 (0)