diff options
author | Bob Van Landuyt <bob@gitlab.com> | 2019-07-23 15:39:26 +0300 |
---|---|---|
committer | Bob Van Landuyt <bob@gitlab.com> | 2019-07-23 15:39:26 +0300 |
commit | 825e5c2c1b1cd98f3daf99f22fea910f075f48f9 (patch) | |
tree | a149601d370d94c0bbc9bf7e6639b25470f4a804 /app/models | |
parent | d97dac9d6b9a16f1d796e506ceb2d69b87b804c3 (diff) | |
parent | 313f145b5594ebba7ce4675905061144adb3b44a (diff) |
Merge branch 'if-64257-active_session_lookup_key_cleanup' into 'master'
Rake task to cleanup expired ActiveSession lookup keys
See merge request gitlab-org/gitlab-ce!30668
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/active_session.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/app/models/active_session.rb b/app/models/active_session.rb index 345767179eb..fdd210f0fba 100644 --- a/app/models/active_session.rb +++ b/app/models/active_session.rb @@ -93,12 +93,12 @@ class ActiveSession end def self.list_sessions(user) - sessions_from_ids(session_ids_for_user(user)) + sessions_from_ids(session_ids_for_user(user.id)) end - def self.session_ids_for_user(user) + def self.session_ids_for_user(user_id) Gitlab::Redis::SharedState.with do |redis| - redis.smembers(lookup_key_name(user.id)) + redis.smembers(lookup_key_name(user_id)) end end @@ -129,7 +129,7 @@ class ActiveSession end def self.cleaned_up_lookup_entries(redis, user) - session_ids = session_ids_for_user(user) + session_ids = session_ids_for_user(user.id) entries = raw_active_session_entries(session_ids, user.id) # remove expired keys. |