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

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'internal/middleware/limithandler/limithandler.go')
-rw-r--r--internal/middleware/limithandler/limithandler.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/internal/middleware/limithandler/limithandler.go b/internal/middleware/limithandler/limithandler.go
index 7d8d6ab8f..00dc96450 100644
--- a/internal/middleware/limithandler/limithandler.go
+++ b/internal/middleware/limithandler/limithandler.go
@@ -108,6 +108,10 @@ func createLimiterConfig() map[string]*ConcurrencyLimiter {
result[fullMethodName] = NewLimiter(max, NewPromMonitor("gitaly", fullMethodName))
}
+ for fullMethodName, _ := range idempotentRPCs {
+ result[fullMethodName] = NewIdempotentLimiter(NewPromMonitor("gitaly", fullMethodName))
+ }
+
return result
}
@@ -115,3 +119,8 @@ func createLimiterConfig() map[string]*ConcurrencyLimiter {
func SetMaxRepoConcurrency(config map[string]int) {
maxConcurrencyPerRepoPerRPC = config
}
+
+var idempotentRPCs = map[string]struct{}{
+ "/gitaly.RepositoryService/ReplicateRepository": {},
+ "/gitaly.RepositoryService/OptimizeRepository": {},
+}