Welcome to mirror list, hosted at ThFree Co, Russian Federation.

concurrency.go « config « internal - gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 7211bd3e1d780da60649c7bd3dbec0318ab1eb18 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
package config

import (
	"gitlab.com/gitlab-org/gitaly/internal/middleware/limithandler"
)

// ConfigureConcurrencyLimits configures the per-repo, per RPC rate limits
func ConfigureConcurrencyLimits() {
	maxConcurrencyPerRepoPerRPC := make(map[string]int)

	for _, v := range Config.Concurrency {
		maxConcurrencyPerRepoPerRPC[v.RPC] = v.MaxPerRepo
	}

	limithandler.SetMaxRepoConcurrency(maxConcurrencyPerRepoPerRPC)
}