aboutsummaryrefslogtreecommitdiffstats
path: root/modules/indexer/code/queue.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2019-12-25 17:44:09 +0800
committerGitHub <noreply@github.com>2019-12-25 17:44:09 +0800
commit8b2f29c0d2e571b45f004646d3b5e6bac1c2c419 (patch)
tree2756a191d78ab576b3042109ac6572f956aa7f53 /modules/indexer/code/queue.go
parentf88715e29c8cd6865b69eb8e692d051d977e93a5 (diff)
downloadgitea-8b2f29c0d2e571b45f004646d3b5e6bac1c2c419.tar.gz
gitea-8b2f29c0d2e571b45f004646d3b5e6bac1c2c419.zip
fix datarace on issue indexer queue (#9490)
Diffstat (limited to 'modules/indexer/code/queue.go')
-rw-r--r--modules/indexer/code/queue.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/indexer/code/queue.go b/modules/indexer/code/queue.go
index 82cd8ded53..4eeb6ac7d4 100644
--- a/modules/indexer/code/queue.go
+++ b/modules/indexer/code/queue.go
@@ -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: