diff options
author | Claire <claire.github-309c@sitedethib.com> | 2020-12-23 01:47:45 +0100 |
---|---|---|
committer | Claire <claire.github-309c@sitedethib.com> | 2020-12-23 01:47:45 +0100 |
commit | 537afa00f35dbaa98cbff284683317b411104a82 (patch) | |
tree | d71a57d5f5b6bd864ec11cc1c914a6c3b30ba612 /app/workers | |
parent | 81f4c550b2ed305f39f344d10289b38625f70bf7 (diff) | |
parent | 444b21b55ff5768e4cbbaf7cfa8285c65a4b54f9 (diff) |
Merge branch 'master' into glitch-soc/merge-upstream
Conflicts: - `app/lib/feed_manager.rb`: Not a real conflict, glitch-soc-only DM-related method too close to changed upstream stuff. Ported upstream changes. - `app/services/batched_remove_status_service.rb`: Additional logic in glitch-soc to clear DMs from timelines. Ported upstream changes and fixed the DM TL clearing logic. - `app/workers/scheduler/feed_cleanup_scheduler.rb`: Additional code in glitch-soc to clear DM timelines. Ported upstream changes.
Diffstat (limited to 'app/workers')
-rw-r--r-- | app/workers/scheduler/feed_cleanup_scheduler.rb | 32 |
1 files changed, 3 insertions, 29 deletions
diff --git a/app/workers/scheduler/feed_cleanup_scheduler.rb b/app/workers/scheduler/feed_cleanup_scheduler.rb index 99e3440fe..96c17c578 100644 --- a/app/workers/scheduler/feed_cleanup_scheduler.rb +++ b/app/workers/scheduler/feed_cleanup_scheduler.rb @@ -15,41 +15,15 @@ class Scheduler::FeedCleanupScheduler private def clean_home_feeds! - clean_feeds!(inactive_account_ids, :home) + feed_manager.clean_feeds!(:home, inactive_account_ids) end def clean_list_feeds! - clean_feeds!(inactive_list_ids, :list) + feed_manager.clean_feeds!(:list, inactive_list_ids) end def clean_direct_feeds! - clean_feeds!(inactive_account_ids, :direct) - end - - def clean_feeds!(ids, type) - reblogged_id_sets = {} - - redis.pipelined do - ids.each do |feed_id| - redis.del(feed_manager.key(type, feed_id)) - reblog_key = feed_manager.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) - 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 = feed_manager.key(type, feed_id, "reblogs:#{reblogged_id}") - redis.del(reblog_set_key) - end - end - end + feed_manager.clean_feeds!(:direct, inactive_account_ids) end def inactive_account_ids |