]> cat aescling's git repositories - mastodon.git/blob - app/workers/push_conversation_worker.rb
Fix records not being indexed sometimes (#12024)
[mastodon.git] / app / workers / push_conversation_worker.rb
1 # frozen_string_literal: true
2
3 class PushConversationWorker
4 include Sidekiq::Worker
5
6 def perform(conversation_account_id)
7 conversation = AccountConversation.find(conversation_account_id)
8 message = InlineRenderer.render(conversation, conversation.account, :conversation)
9 timeline_id = "timeline:direct:#{conversation.account_id}"
10
11 Redis.current.publish(timeline_id, Oj.dump(event: :conversation, payload: message, queued_at: (Time.now.to_f * 1000.0).to_i))
12 rescue ActiveRecord::RecordNotFound
13 true
14 end
15 end
This page took 0.078643 seconds and 4 git commands to generate.