]>
cat aescling's git repositories - mastodon.git/blob - app/workers/push_conversation_worker.rb
1 # frozen_string_literal: true
3 class PushConversationWorker
4 include Sidekiq
::Worker
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}"
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
This page took 0.078643 seconds and 4 git commands to generate.