Update push_update_worker.rb redis

This commit is contained in:
admin 2021-01-16 18:43:24 +00:00
parent da98d61c2c
commit 29cfe511d1

View File

@ -9,7 +9,9 @@ class PushUpdateWorker
message = InlineRenderer.render(status, account, :status) message = InlineRenderer.render(status, account, :status)
timeline_id = "timeline:#{account.id}" if timeline_id.nil? 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 true
rescue ActiveRecord::RecordNotFound rescue ActiveRecord::RecordNotFound
true true