diff --git a/app/lib/channel_feed_manager.rb b/app/lib/channel_feed_manager.rb index 65ee1e2ab..867fbdbe7 100644 --- a/app/lib/channel_feed_manager.rb +++ b/app/lib/channel_feed_manager.rb @@ -20,10 +20,13 @@ def batch_to_feed(channel_id, status_ids) # Adds to Channels Feed, but only those filtered # by the channels threshold - def batch_to_threshold(channel_id, status_ids) - statuses = status_ids.zip(status_ids) + # keeping both id and account_id of each status for breadcrumbs + # we serialize it to json to store + def batch_to_threshold(channel_id, statuses) + # statuses = status_ids.zip(status_ids) + batch_statuses = statuses.map { |s| [s[:id], s.to_json] } - perform_push_to_threshold(channel_id, statuses) + perform_push_to_threshold(channel_id, batch_statuses) end private @@ -40,8 +43,6 @@ def perform_push_to_threshold(channel_id, statuses) # Do the acutal adding to redis def push(channel_key, statuses) - Rails.logger.debug { "PUSH TO REDIS: #{channel_key}" } - Rails.logger.debug { "PUSH TO REDIS: #{statuses.inspect}" } redis.zadd(channel_key, statuses) # Keep the list from growning infinitely trim(channel_key) diff --git a/app/workers/scheduler/channel_mammoth_statuses_scheduler.rb b/app/workers/scheduler/channel_mammoth_statuses_scheduler.rb index 3e469b063..aac5b5ecd 100644 --- a/app/workers/scheduler/channel_mammoth_statuses_scheduler.rb +++ b/app/workers/scheduler/channel_mammoth_statuses_scheduler.rb @@ -34,7 +34,7 @@ def update_engagement_threshold_channel_feeds! filtered_channels = Mammoth::Channels.new.filter_statuses_with_threshold filtered_channels.each do |channel| Rails.logger.debug { "FILTER CHANNEL:: #{channel} \n" } - channel_feed_manager.batch_to_threshold(channel[:id], channel[:statuses].pluck('id')) + channel_feed_manager.batch_to_threshold(channel[:id], channel[:statuses].pluck(:id, :account_id)) end end