diff options
| author | Jacob Vosmaer <contact@jacobvosmaer.nl> | 2016-03-10 11:05:59 +0100 |
|---|---|---|
| committer | Jacob Vosmaer <contact@jacobvosmaer.nl> | 2016-03-10 11:05:59 +0100 |
| commit | 0223b58f019fc3ce906c97caf8c6e361fa4302be (patch) | |
| tree | 7e5d2ca3947e4b1548cd4bd7859b21cd421a26f0 | |
| parent | cda0b7e1b142130fd2e4d7073e451a3f8d73b693 (diff) | |
| download | gitlab-ce-0223b58f019fc3ce906c97caf8c6e361fa4302be.tar.gz | |
Explain LDAP "lock" behavior
| -rw-r--r-- | lib/gitlab/ldap/access.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/gitlab/ldap/access.rb b/lib/gitlab/ldap/access.rb index 76786169a49..90d5996757f 100644 --- a/lib/gitlab/ldap/access.rb +++ b/lib/gitlab/ldap/access.rb @@ -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) |
