about summary refs log tree commit diff
path: root/app/workers/push_update_worker.rb
diff options
context:
space:
mode:
authorStarfall <us@starfall.systems>2022-11-10 08:50:11 -0600
committerStarfall <us@starfall.systems>2022-11-10 08:50:11 -0600
commit67d1a0476d77e2ed0ca15dd2981c54c2b90b0742 (patch)
tree152f8c13a341d76738e8e2c09b24711936e6af68 /app/workers/push_update_worker.rb
parentb581e6b6d4a5ba9ed4ae17427b7f2d5d158be4e5 (diff)
parentee7e49d1b1323618e16026bc8db8ab7f9459cc2d (diff)
Merge remote-tracking branch 'glitch/main'
- Remove Helm charts
- Lots of conflicts with our removal of recommended settings and custom
  icons
Diffstat (limited to 'app/workers/push_update_worker.rb')
-rw-r--r--app/workers/push_update_worker.rb11
1 files changed, 6 insertions, 5 deletions
diff --git a/app/workers/push_update_worker.rb b/app/workers/push_update_worker.rb
index ae444cfde..72c781749 100644
--- a/app/workers/push_update_worker.rb
+++ b/app/workers/push_update_worker.rb
@@ -5,11 +5,12 @@ class PushUpdateWorker
   include Redisable
 
   def perform(account_id, status_id, timeline_id = nil, options = {})
-    @account     = Account.find(account_id)
     @status      = Status.find(status_id)
-    @timeline_id = timeline_id || "timeline:#{account.id}"
+    @account_id  = account_id
+    @timeline_id = timeline_id || "timeline:#{account_id}"
     @options     = options.symbolize_keys
 
+    render_payload!
     publish!
   rescue ActiveRecord::RecordNotFound
     true
@@ -17,14 +18,14 @@ class PushUpdateWorker
 
   private
 
-  def payload
-    InlineRenderer.render(@status, @account, :status)
+  def render_payload!
+    @payload = StatusCacheHydrator.new(@status).hydrate(@account_id)
   end
 
   def message
     Oj.dump(
       event: update? ? :'status.update' : :update,
-      payload: payload,
+      payload: @payload,
       queued_at: (Time.now.to_f * 1000.0).to_i
     )
   end