diff options
author | John Cai <jcai@gitlab.com> | 2022-03-21 21:20:06 +0300 |
---|---|---|
committer | John Cai <jcai@gitlab.com> | 2022-04-05 20:57:43 +0300 |
commit | 31259d9d793cce6f62a1b1f8e6a4649072742c00 (patch) | |
tree | 6e4e86bfc1edef0559017e3cd454d1005e3723dc /internal/gitaly/service | |
parent | aad545f661c295bcff422424e76abe7c2fd85a10 (diff) |
limithandler: Pave the way for a second limiter type
A future commit will add a new middleware that will limit based on the
rate rather than concurrent calls. There is a good amount of logic
currently used by the concurrency limiter that can be reused since a
rate limiter is also operating on incoming requests based on RPC name.
To make easier to add this new limiter type in the future, refactor the
code by adding some abstractions easier to add another type of limiter.
Diffstat (limited to 'internal/gitaly/service')
-rw-r--r-- | internal/gitaly/service/repository/create_fork_test.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/internal/gitaly/service/repository/create_fork_test.go b/internal/gitaly/service/repository/create_fork_test.go index b8ea85654..b3d0ceaa3 100644 --- a/internal/gitaly/service/repository/create_fork_test.go +++ b/internal/gitaly/service/repository/create_fork_test.go @@ -259,7 +259,7 @@ func runSecureServer(t *testing.T, cfg config.Cfg, rubySrv *rubyserver.Server) s registry := backchannel.NewRegistry() locator := config.NewLocator(cfg) cache := cache.New(cfg, locator) - limitHandler := limithandler.New(cfg, limithandler.LimitConcurrencyByRepo) + limitHandler := limithandler.New(cfg, limithandler.LimitConcurrencyByRepo, limithandler.WithConcurrencyLimiters) server, err := gserver.New(true, cfg, testhelper.NewDiscardingLogEntry(t), registry, cache, limitHandler) require.NoError(t, err) listener, addr := testhelper.GetLocalhostListener(t) |