Skip to content

Commit

Permalink
purge key list
Browse files Browse the repository at this point in the history
  • Loading branch information
jtomchak committed Jan 29, 2024
1 parent 9615ef5 commit 8b4b306
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions app/lib/mammoth/status_origin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,13 @@ def reset(acct)
username, domain = acct.strip.gsub(/\A@/, '').split('@')
return nil unless username && domain

list_key = key("#{username}@#{domain}")
redis.keys("#{list_key}*").each { |key| redis.del(key) }
user_list_key = key("#{username}@#{domain}")
keys_to_purge = redis.zrange(user_list_key, 0, -1)
redis.pipelined do |p|
p.del(keys_to_purge)
p.del(user_list_key)
end

end

private
Expand Down

0 comments on commit 8b4b306

Please sign in to comment.