43f037c903
It seems that bad things happen when two gRPC stubs share one gRPC channel so let's stop doing that. The downside of this is that we create more gRPC connections; one per stub.
18 lines
465 B
Ruby
18 lines
465 B
Ruby
module Gitlab
|
|
module GitalyClient
|
|
class Notifications
|
|
attr_accessor :stub
|
|
|
|
# 'repository' is a Gitlab::Git::Repository
|
|
def initialize(repository)
|
|
@gitaly_repo = repository.gitaly_repository
|
|
@stub = GitalyClient.stub(:notifications, repository.storage)
|
|
end
|
|
|
|
def post_receive
|
|
request = Gitaly::PostReceiveRequest.new(repository: @gitaly_repo)
|
|
@stub.post_receive(request)
|
|
end
|
|
end
|
|
end
|
|
end
|