Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions modules/indexer/code/indexer.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ func Init() {
return
}

initQueue(setting.Indexer.UpdateQueueLength)

ctx, cancel := context.WithCancel(context.Background())

graceful.GetManager().RunAtTerminate(ctx, func() {
Expand Down
5 changes: 4 additions & 1 deletion modules/indexer/code/queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down