Merge branch 'main' into glitch-soc/merge-upstream
Conflicts: - `README.md`: Upstream README has been changed, but we have a completely different one. Kept our `README.md`. - `lib/sanitize_ext/sanitize_config.rb`: Upstream added support for more incoming HTML tags (a large subset of what glitch-soc accepts). Change the code style to match upstream's but otherwise do not change our code. - `spec/lib/sanitize_config_spec.rb`: Upstream added support for more incoming HTML tags (a large subset of what glitch-soc accepts). Kept our version, since the tests are mostly glitch-soc's, except for cases which are purposefuly different.
This commit is contained in:
@ -322,27 +322,27 @@ class FeedManager
|
||||
def clean_feeds!(type, ids)
|
||||
reblogged_id_sets = {}
|
||||
|
||||
redis.pipelined do
|
||||
redis.pipelined do |pipeline|
|
||||
ids.each do |feed_id|
|
||||
redis.del(key(type, feed_id))
|
||||
reblog_key = key(type, feed_id, 'reblogs')
|
||||
# We collect a future for this: we don't block while getting
|
||||
# it, but we can iterate over it later.
|
||||
reblogged_id_sets[feed_id] = redis.zrange(reblog_key, 0, -1)
|
||||
redis.del(reblog_key)
|
||||
reblogged_id_sets[feed_id] = pipeline.zrange(reblog_key, 0, -1)
|
||||
pipeline.del(key(type, feed_id), reblog_key)
|
||||
end
|
||||
end
|
||||
|
||||
# Remove all of the reblog tracking keys we just removed the
|
||||
# references to.
|
||||
redis.pipelined do
|
||||
reblogged_id_sets.each do |feed_id, future|
|
||||
future.value.each do |reblogged_id|
|
||||
reblog_set_key = key(type, feed_id, "reblogs:#{reblogged_id}")
|
||||
redis.del(reblog_set_key)
|
||||
end
|
||||
keys_to_delete = reblogged_id_sets.flat_map do |feed_id, future|
|
||||
future.value.map do |reblogged_id|
|
||||
key(type, feed_id, "reblogs:#{reblogged_id}")
|
||||
end
|
||||
end
|
||||
|
||||
redis.del(keys_to_delete) unless keys_to_delete.empty?
|
||||
|
||||
nil
|
||||
end
|
||||
|
||||
private
|
||||
|
Reference in New Issue
Block a user