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