Update push_update_worker.rb redis

This commit is contained in:
admin 2021-01-16 18:43:24 +00:00
parent da98d61c2c
commit 29cfe511d1
1 changed files with 3 additions and 1 deletions

View File

@ -9,7 +9,9 @@ class PushUpdateWorker
message = InlineRenderer.render(status, account, :status)
timeline_id = "timeline:#{account.id}" if timeline_id.nil?
Redis.current.publish(timeline_id, Oj.dump(event: :update, payload: message, queued_at: (Time.now.to_f * 1000.0).to_i))
Redis.current.with do |conn|
conn.publish(timeline_id, Oj.dump(event: :update, payload: message, queued_at: (Time.now.to_f * 1000.0).to_i))
end
true
rescue ActiveRecord::RecordNotFound
true