Skip to content
Snippets Groups Projects
Commit 0223b58f authored by Jacob Vosmaer's avatar Jacob Vosmaer
Browse files

Explain LDAP "lock" behavior

parent cda0b7e1
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -7,10 +7,14 @@ module Gitlab
class Access
attr_reader :provider, :user
 
LOCK_TIMEOUT = 600
# This timeout acts as a throttle on LDAP user checks. Its value of 600
# seconds (10 minutes) means that after calling try_lock_user for user
# janedoe, no new LDAP checks can start for that user for the next 10
# minutes.
LEASE_TIMEOUT = 600
 
def self.try_lock_user(user)
Gitlab::ExclusiveLease.new("user_ldap_check:#{user.id}", LOCK_TIMEOUT).try_obtain
Gitlab::ExclusiveLease.new("user_ldap_check:#{user.id}", LEASE_TIMEOUT).try_obtain
end
 
def self.open(user, &block)
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment