about summary refs log tree commit diff
path: root/app/workers/push_update_worker.rb
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2017-04-05 19:45:18 +0200
committerEugen Rochko <eugen@zeonfederated.com>2017-04-05 19:45:18 +0200
commit5b95be1c42ba69c9a3a79cfa990c80a5f2debfc6 (patch)
tree297367867dfee6a584bcd16d631a2f8714ddfd80 /app/workers/push_update_worker.rb
parentd755ce96da00cee1c8e51204cf5ede79764f4fb9 (diff)
Replace calls to FeedManager#inline_render and #broadcast
Diffstat (limited to 'app/workers/push_update_worker.rb')
-rw-r--r--app/workers/push_update_worker.rb13
1 files changed, 3 insertions, 10 deletions
diff --git a/app/workers/push_update_worker.rb b/app/workers/push_update_worker.rb
index 166a9b449..fbcdcf634 100644
--- a/app/workers/push_update_worker.rb
+++ b/app/workers/push_update_worker.rb
@@ -3,19 +3,12 @@
 class PushUpdateWorker
   include Sidekiq::Worker
 
-  def perform(timeline, account_id, status_id)
+  def perform(account_id, status_id)
     account = Account.find(account_id)
     status  = Status.find(status_id)
-    
-    message = Rabl::Renderer.new(
-      'api/v1/statuses/show', 
-      status, 
-      view_path: 'app/views', 
-      format: :json, 
-      scope: InlineRablScope.new(account)
-    )
+    message = InlineRenderer.render(status, account, 'api/v1/statuses/show')
 
-    Redis.current.publish("timeline:#{account.id}", Oj.dump({ event: :update, payload: message, queued_at: (Time.now.to_f * 1000.0).to_i }))
+    Redis.current.publish("timeline:#{account.id}", Oj.dump(event: :update, payload: message, queued_at: (Time.now.to_f * 1000.0).to_i))
   rescue ActiveRecord::RecordNotFound
     true
   end