Commit 9fd644f8 authored by Imre Farkas's avatar Imre Farkas Committed by Thong Kuah

ActiveSession.cleaned_up_lookup_entries to use Redis#pipelined

parent f5fcb9a1
...@@ -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