forked from forgejo/forgejo
New push to base repo of base branch: retest all corresponding patches
This commit is contained in:
parent
71d8ff247d
commit
2be5837cb0
2 changed files with 69 additions and 29 deletions
|
@ -465,7 +465,7 @@ func (q *UniqueQueue) Remove(id interface{}) {
|
|||
delete(q.ids, com.ToStr(id))
|
||||
}
|
||||
|
||||
func (q *UniqueQueue) Add(id interface{}) {
|
||||
func (q *UniqueQueue) AddFunc(id interface{}, fn func()) {
|
||||
newid := com.ToStr(id)
|
||||
|
||||
if q.Exist(id) {
|
||||
|
@ -474,10 +474,17 @@ func (q *UniqueQueue) Add(id interface{}) {
|
|||
|
||||
q.lock.Lock()
|
||||
q.ids[newid] = true
|
||||
if fn != nil {
|
||||
fn()
|
||||
}
|
||||
q.lock.Unlock()
|
||||
q.queue <- newid
|
||||
}
|
||||
|
||||
func (q *UniqueQueue) Add(id interface{}) {
|
||||
q.AddFunc(id, nil)
|
||||
}
|
||||
|
||||
func (q *UniqueQueue) Exist(id interface{}) bool {
|
||||
q.lock.Lock()
|
||||
defer q.lock.Unlock()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue