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

added back now that we will have timeline/notification queueing functionality
This commit is contained in:
mgabdev 2019-07-11 12:11:57 -04:00
parent ebc44ed743
commit 49e533244c
4 changed files with 9 additions and 9 deletions

View File

@ -30,7 +30,7 @@ class FeedManager
def push_to_home(account, status) def push_to_home(account, status)
return false unless add_to_feed(:home, account.id, status, account.user&.aggregates_reblogs?) return false unless add_to_feed(:home, account.id, status, account.user&.aggregates_reblogs?)
trim(:home, account.id) 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 true
end end
@ -48,7 +48,7 @@ class FeedManager
end end
return false unless add_to_feed(:list, list.id, status, list.account.user&.aggregates_reblogs?) return false unless add_to_feed(:list, list.id, status, list.account.user&.aggregates_reblogs?)
trim(:list, list.id) 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 true
end end

View File

@ -61,7 +61,7 @@ class FanOutOnWriteService < BaseService
Rails.logger.debug "Delivering status #{status.id} to group" 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 end
def deliver_to_mentioned_followers(status) def deliver_to_mentioned_followers(status)
@ -89,15 +89,15 @@ class FanOutOnWriteService < BaseService
def deliver_to_public(status) def deliver_to_public(status)
Rails.logger.debug "Delivering status #{status.id} to public timeline" Rails.logger.debug "Delivering status #{status.id} to public timeline"
# Redis.current.publish('timeline:public', @payload) Redis.current.publish('timeline:public', @payload)
# Redis.current.publish('timeline:public:local', @payload) if status.local? Redis.current.publish('timeline:public:local', @payload) if status.local?
end end
def deliver_to_media(status) def deliver_to_media(status)
Rails.logger.debug "Delivering status #{status.id} to media timeline" Rails.logger.debug "Delivering status #{status.id} to media timeline"
# Redis.current.publish('timeline:public:media', @payload) Redis.current.publish('timeline:public:media', @payload)
# Redis.current.publish('timeline:public:local:media', @payload) if status.local? Redis.current.publish('timeline:public:local:media', @payload) if status.local?
end end
def deliver_to_own_conversation(status) def deliver_to_own_conversation(status)

View File

@ -7,7 +7,7 @@ class PushConversationWorker
conversation = AccountConversation.find(conversation_account_id) conversation = AccountConversation.find(conversation_account_id)
message = InlineRenderer.render(conversation, conversation.account, :conversation) message = InlineRenderer.render(conversation, conversation.account, :conversation)
timeline_id = "timeline:direct:#{conversation.account_id}" 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 true
rescue ActiveRecord::RecordNotFound rescue ActiveRecord::RecordNotFound
true true

View File

@ -9,7 +9,7 @@ class PushUpdateWorker
message = InlineRenderer.render(status, account, :status) message = InlineRenderer.render(status, account, :status)
timeline_id = "timeline:#{account.id}" if timeline_id.nil? 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 true
rescue ActiveRecord::RecordNotFound rescue ActiveRecord::RecordNotFound
true true