summaryrefslogtreecommitdiffstats
path: root/models/webhook.go
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-10-24 14:48:11 -0400
committerUnknwon <u@gogs.io>2015-10-24 14:48:11 -0400
commit2be5837cb04d016ef8e6d89eee441dfaad1ce34d (patch)
treee0f4dc60ac093c062031e01a62c0fe460d8ee98d /models/webhook.go
parent71d8ff247d35eb366c6ea417555bed15e8675a31 (diff)
downloadgitea-2be5837cb04d016ef8e6d89eee441dfaad1ce34d.tar.gz
gitea-2be5837cb04d016ef8e6d89eee441dfaad1ce34d.zip
New push to base repo of base branch: retest all corresponding patches
Diffstat (limited to 'models/webhook.go')
-rw-r--r--models/webhook.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/models/webhook.go b/models/webhook.go
index 7b6d7826e7..b4d7dc9c71 100644
--- a/models/webhook.go
+++ b/models/webhook.go
@@ -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()