]> cat aescling's git repositories - mastodon.git/blob - app/workers/push_update_worker.rb
Fix default searchTokens (#15775)
[mastodon.git] / app / workers / push_update_worker.rb
1 # frozen_string_literal: true
2
3 class PushUpdateWorker
4 include Sidekiq::Worker
5
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?
11
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
14 true
15 end
16 end
This page took 0.088901 seconds and 4 git commands to generate.