Commit 49e53324 authored by mgabdev's avatar mgabdev

Updated all Redis.current.publish, PushUpdateWorker.perform_async to work again

added back now that we will have timeline/notification queueing functionality
parent ebc44ed7
......@@ -30,7 +30,7 @@ class FeedManager
def push_to_home(account, status)
return false unless add_to_feed(:home, account.id, status, account.user&.aggregates_reblogs?)
trim(:home, account.id)
#PushUpdateWorker.perform_async(account.id, status.id, "timeline:#{account.id}") if push_update_required?("timeline:#{account.id}")
PushUpdateWorker.perform_async(account.id, status.id, "timeline:#{account.id}") if push_update_required?("timeline:#{account.id}")
true
end
......@@ -48,7 +48,7 @@ class FeedManager
end
return false unless add_to_feed(:list, list.id, status, list.account.user&.aggregates_reblogs?)
trim(:list, list.id)
#PushUpdateWorker.perform_async(list.account_id, status.id, "timeline:list:#{list.id}") if push_update_required?("timeline:list:#{list.id}")
PushUpdateWorker.perform_async(list.account_id, status.id, "timeline:list:#{list.id}") if push_update_required?("timeline:list:#{list.id}")
true
end
......
......@@ -61,7 +61,7 @@ class FanOutOnWriteService < BaseService
Rails.logger.debug "Delivering status #{status.id} to group"
# Redis.current.publish("timeline:group:#{status.group_id}", @payload)
Redis.current.publish("timeline:group:#{status.group_id}", @payload)
end
def deliver_to_mentioned_followers(status)
......@@ -89,15 +89,15 @@ class FanOutOnWriteService < BaseService
def deliver_to_public(status)
Rails.logger.debug "Delivering status #{status.id} to public timeline"
# Redis.current.publish('timeline:public', @payload)
# Redis.current.publish('timeline:public:local', @payload) if status.local?
Redis.current.publish('timeline:public', @payload)
Redis.current.publish('timeline:public:local', @payload) if status.local?
end
def deliver_to_media(status)
Rails.logger.debug "Delivering status #{status.id} to media timeline"
# Redis.current.publish('timeline:public:media', @payload)
# Redis.current.publish('timeline:public:local:media', @payload) if status.local?
Redis.current.publish('timeline:public:media', @payload)
Redis.current.publish('timeline:public:local:media', @payload) if status.local?
end
def deliver_to_own_conversation(status)
......
......@@ -7,7 +7,7 @@ class PushConversationWorker
conversation = AccountConversation.find(conversation_account_id)
message = InlineRenderer.render(conversation, conversation.account, :conversation)
timeline_id = "timeline:direct:#{conversation.account_id}"
# Redis.current.publish(timeline_id, Oj.dump(event: :conversation, payload: message, queued_at: (Time.now.to_f * 1000.0).to_i))
Redis.current.publish(timeline_id, Oj.dump(event: :conversation, payload: message, queued_at: (Time.now.to_f * 1000.0).to_i))
true
rescue ActiveRecord::RecordNotFound
true
......
......@@ -9,7 +9,7 @@ class PushUpdateWorker
message = InlineRenderer.render(status, account, :status)
timeline_id = "timeline:#{account.id}" if timeline_id.nil?
# Redis.current.publish(timeline_id, Oj.dump(event: :update, payload: message, queued_at: (Time.now.to_f * 1000.0).to_i))
Redis.current.publish(timeline_id, Oj.dump(event: :update, payload: message, queued_at: (Time.now.to_f * 1000.0).to_i))
true
rescue ActiveRecord::RecordNotFound
true
......
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