modules/sync: add UniqueQueue

This commit is contained in:
Unknwon 2016-08-30 15:50:30 -07:00
parent 43297148b2
commit c1ecb6c60a
3 changed files with 76 additions and 62 deletions

View file

@ -20,8 +20,11 @@ import (
"github.com/gogits/gogs/modules/log"
"github.com/gogits/gogs/modules/process"
"github.com/gogits/gogs/modules/setting"
"github.com/gogits/gogs/modules/sync"
)
var PullRequestQueue = sync.NewUniqueQueue(setting.Repository.PullRequestQueueLength)
type PullRequestType int
const (
@ -537,8 +540,6 @@ func (pr *PullRequest) UpdateCols(cols ...string) error {
return err
}
var PullRequestQueue = NewUniqueQueue(setting.Repository.PullRequestQueueLength)
// UpdatePatch generates and saves a new patch.
func (pr *PullRequest) UpdatePatch() (err error) {
if err = pr.GetHeadRepo(); err != nil {