]>
cat aescling's git repositories - mastodon.git/blob - app/workers/push_update_worker.rb
1 # frozen_string_literal: true
4 include Sidekiq
::Worker
6 def perform(account_id
, status_id
, timeline_id
= nil)
7 account
= Account
.find(account_id
)
8 status
= Status
.find(status_id
)
9 message
= InlineRenderer
.render(status
, account
, :status)
10 timeline_id
= "timeline:#{account.id}" if timeline_id
.nil?
12 Redis
.current
.publish(timeline_id
, Oj
.dump(event
: :update, payload
: message
, queued_at
: (Time
.now
.to_f
* 1000.0).to_i
))
13 rescue ActiveRecord
::RecordNotFound
This page took 0.088901 seconds and 4 git commands to generate.