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:
authorSami Hiltunen <shiltunen@gitlab.com>2023-06-30 14:29:10 +0300
committerSami Hiltunen <shiltunen@gitlab.com>2023-10-18 00:20:42 +0300
commit0dc4822047a55270d41782467ce9b11fc7e43699 (patch)
treed1d259889b74d03cf335fd348431bfec39dd1d72 /internal/gitaly/server/auth_test.go
parenta91155af93c4f0376370f3f8e83ac06d6d5d37e4 (diff)
Wire TransactionMiddleware to GitalyServerFactory
We'll soon have middleware to handle transaction management for RPC in a general manner. This commit wires GitalyServerFactory to optionally configure a middleware for doing so in the right location.
Diffstat (limited to 'internal/gitaly/server/auth_test.go')
-rw-r--r--internal/gitaly/server/auth_test.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/internal/gitaly/server/auth_test.go b/internal/gitaly/server/auth_test.go
index 7300a6ef8..befe375e4 100644
--- a/internal/gitaly/server/auth_test.go
+++ b/internal/gitaly/server/auth_test.go
@@ -203,7 +203,7 @@ func runServer(t *testing.T, cfg config.Cfg) string {
limitHandler := limithandler.New(cfg, limithandler.LimitConcurrencyByRepo, setupPerRPCConcurrencyLimiters)
updaterWithHooks := updateref.NewUpdaterWithHooks(cfg, logger, locator, hookManager, gitCmdFactory, catfileCache)
- srv, err := NewGitalyServerFactory(cfg, logger, registry, diskCache, []*limithandler.LimiterMiddleware{limitHandler}).New(false)
+ srv, err := NewGitalyServerFactory(cfg, logger, registry, diskCache, []*limithandler.LimiterMiddleware{limitHandler}, TransactionMiddleware{}).New(true, false)
require.NoError(t, err)
setup.RegisterAll(srv, &service.Dependencies{
@@ -246,7 +246,8 @@ func runSecureServer(t *testing.T, cfg config.Cfg) string {
backchannel.NewRegistry(),
cache.New(cfg, config.NewLocator(cfg), testhelper.SharedLogger(t)),
[]*limithandler.LimiterMiddleware{limithandler.New(cfg, limithandler.LimitConcurrencyByRepo, setupPerRPCConcurrencyLimiters)},
- ).New(true)
+ TransactionMiddleware{},
+ ).New(true, true)
require.NoError(t, err)
healthpb.RegisterHealthServer(srv, health.NewServer())