From 29cfe511d17afcfaafa0b68c092f60f8eaa32f3b Mon Sep 17 00:00:00 2001 From: admin Date: Sat, 16 Jan 2021 18:43:24 +0000 Subject: [PATCH] Update push_update_worker.rb redis --- app/workers/push_update_worker.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/workers/push_update_worker.rb b/app/workers/push_update_worker.rb index a491848e..a652719d 100644 --- a/app/workers/push_update_worker.rb +++ b/app/workers/push_update_worker.rb @@ -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