From 3344afbb3de3688992b5d76e6b98b438522d570b Mon Sep 17 00:00:00 2001 From: admin Date: Sat, 16 Jan 2021 18:47:38 +0000 Subject: [PATCH] Update tag.rb redis --- app/models/tag.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/models/tag.rb b/app/models/tag.rb index f34f8424..cd70755c 100644 --- a/app/models/tag.rb +++ b/app/models/tag.rb @@ -55,8 +55,12 @@ class Tag < ApplicationRecord days << { day: day.to_s, - uses: Redis.current.get("activity:tags:#{id}:#{day}") || '0', - accounts: Redis.current.pfcount("activity:tags:#{id}:#{day}:accounts").to_s, + uses: Redis.current.with do |conn| + conn.get("activity:tags:#{id}:#{day}") || '0' + end, + accounts: Redis.current.with do |conn| + conn.pfcount("activity:tags:#{id}:#{day}:accounts").to_s + end, } end