diff options
author | Imre Farkas <ifarkas@gitlab.com> | 2019-08-07 09:32:05 +0000 |
---|---|---|
committer | Thong Kuah <tkuah@gitlab.com> | 2019-08-07 09:32:05 +0000 |
commit | 9fd644f8f88dd330b87e067c2ba65534d1321944 (patch) | |
tree | f77f778bb19abe1d5a2e3df678af0b776251ed92 /app | |
parent | f5fcb9a1be906dd647cb1ffed29d8499370a927e (diff) | |
download | gitlab-ce-9fd644f8f88dd330b87e067c2ba65534d1321944.tar.gz |
ActiveSession.cleaned_up_lookup_entries to use Redis#pipelined
Diffstat (limited to 'app')
-rw-r--r-- | app/models/active_session.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/app/models/active_session.rb b/app/models/active_session.rb index fdd210f0fba..00192b1da59 100644 --- a/app/models/active_session.rb +++ b/app/models/active_session.rb @@ -136,8 +136,10 @@ class ActiveSession # only the single key entries are automatically expired by redis, the # lookup entries in the set need to be removed manually. session_ids_and_entries = session_ids.zip(entries) - session_ids_and_entries.reject { |_session_id, entry| entry }.each do |session_id, _entry| - redis.srem(lookup_key_name(user.id), session_id) + redis.pipelined do + session_ids_and_entries.reject { |_session_id, entry| entry }.each do |session_id, _entry| + redis.srem(lookup_key_name(user.id), session_id) + end end entries.compact |