Redis connection pooling updates

This commit is contained in:
Fosco Marotto
2021-01-16 13:52:11 -05:00
parent 8a3ed8d921
commit 8d48c3ce3d
6 changed files with 64 additions and 48 deletions

View File

@@ -3,7 +3,9 @@
class Api::V1::ExpensesController < EmptyController
def show
amount = Redis.current.get("monthly_funding_amount") || 0
Redis.current.with do |conn|
amount = conn.get("monthly_funding_amount") || 0
end
amount = [amount.to_f, 100].min
render json: { "expenses": amount }
end