Commit 2006724e authored by Thong Kuah's avatar Thong Kuah

Merge branch 'if-64985-redis_pipelined_in_active_session' into 'master'

ActiveSession.cleaned_up_lookup_entries to use Redis#pipelined

See merge request gitlab-org/gitlab-ce!31096
parents f5fcb9a1 9fd644f8
...@@ -136,8 +136,10 @@ class ActiveSession ...@@ -136,8 +136,10 @@ class ActiveSession
# only the single key entries are automatically expired by redis, the # only the single key entries are automatically expired by redis, the
# lookup entries in the set need to be removed manually. # lookup entries in the set need to be removed manually.
session_ids_and_entries = session_ids.zip(entries) session_ids_and_entries = session_ids.zip(entries)
session_ids_and_entries.reject { |_session_id, entry| entry }.each do |session_id, _entry| redis.pipelined do
redis.srem(lookup_key_name(user.id), session_id) 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 end
entries.compact entries.compact
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment