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:
authorPatrick Steinhardt <psteinhardt@gitlab.com>2021-09-17 13:51:14 +0300
committerPatrick Steinhardt <psteinhardt@gitlab.com>2021-09-17 13:51:22 +0300
commitfdda523bafba3e028d7981c52719e7c1c34ae750 (patch)
treee9dc399fb37d23266d058c40b5e04babad13343e /internal/praefect/repository_exists.go
parentf213ed0fca63fd555cd668283fae05efcb041fcb (diff)
Revert "Merge branch 'smh-intercepted-methods' into 'master'"
This reverts commit 7560fb6cf7a21c7b31c133943f69cc5c9ff5329c, reversing changes made to ccd8ea3e1436d6464ac5f67e6bebd1ae317f4d50. This change has caused issues with QA tests where hundreds of tests now fail with repositories not being found anymore.
Diffstat (limited to 'internal/praefect/repository_exists.go')
-rw-r--r--internal/praefect/repository_exists.go12
1 files changed, 8 insertions, 4 deletions
diff --git a/internal/praefect/repository_exists.go b/internal/praefect/repository_exists.go
index bbafff823..f8ae301cc 100644
--- a/internal/praefect/repository_exists.go
+++ b/internal/praefect/repository_exists.go
@@ -16,10 +16,14 @@ var (
errMissingRelativePath = status.Error(codes.InvalidArgument, "repository missing relative path")
)
-// RepositoryExistsHandler handles /gitaly.RepositoryService/RepositoryExists calls by checking
-// whether there is a record of the repository in the database.
-func RepositoryExistsHandler(rs datastore.RepositoryStore) grpc.StreamHandler {
- return func(srv interface{}, stream grpc.ServerStream) error {
+// RepositoryExistsStreamInterceptor returns a stream interceptor that handles /gitaly.RepositoryService/RepositoryExists
+// calls by checking whether there is a record of the repository in the database.
+func RepositoryExistsStreamInterceptor(rs datastore.RepositoryStore) grpc.StreamServerInterceptor {
+ return func(srv interface{}, stream grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error {
+ if info.FullMethod != "/gitaly.RepositoryService/RepositoryExists" {
+ return handler(srv, stream)
+ }
+
var req gitalypb.RepositoryExistsRequest
if err := stream.RecvMsg(&req); err != nil {
return fmt.Errorf("receive request: %w", err)