1
0
mirror of https://github.com/go-gitea/gitea.git synced 2024-05-11 05:55:29 +00:00

fix datarace on issue indexer queue (#9490)

This commit is contained in:
Lunny Xiao
2019-12-25 17:44:09 +08:00
committed by GitHub
parent f88715e29c
commit 8b2f29c0d2
2 changed files with 6 additions and 1 deletions

View File

@ -21,8 +21,11 @@ type repoIndexerOperation struct {
var repoIndexerOperationQueue chan repoIndexerOperation
func initQueue(queueLength int) {
repoIndexerOperationQueue = make(chan repoIndexerOperation, queueLength)
}
func processRepoIndexerOperationQueue(indexer Indexer) {
repoIndexerOperationQueue = make(chan repoIndexerOperation, setting.Indexer.UpdateQueueLength)
for {
select {
case op := <-repoIndexerOperationQueue: