Commit 797e807249076920d6c4bb71f6258ca05ee0db34

Authored by Jacob Vosmaer
1 parent 11dba4ce

Use LDAP::Access.open to reuse the LDAP connection

Showing 1 changed file with 2 additions and 2 deletions   Show diff stats
lib/gitlab/git_access.rb
... ... @@ -66,8 +66,8 @@ module Gitlab
66 66 if Gitlab.config.ldap.enabled
67 67 if user.ldap_user?
68 68 # Check if LDAP user exists and match LDAP user_filter
69   - unless Gitlab::LDAP::Access.new.allowed?(user)
70   - return false
  69 + Gitlab::LDAP::Access.open do |adapter|
  70 + return false unless adapter.allowed?(user)
71 71 end
72 72 end
73 73 end
... ...