[redis] Example change to redis pooling code.
This commit is contained in:
parent
c9da516af6
commit
8b0f566e4f
@ -1,10 +1,14 @@
|
|||||||
class Admin::ExpensesController < Admin::BaseController
|
class Admin::ExpensesController < Admin::BaseController
|
||||||
def index
|
def index
|
||||||
@amount = Redis.current.get("monthly_funding_amount") || 0
|
Redis.current.with do |conn|
|
||||||
|
@amount = conn.get("monthly_funding_amount") || 0
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def create
|
def create
|
||||||
Redis.current.set("monthly_funding_amount", params[:amount])
|
Redis.current.with do |conn|
|
||||||
|
conn.set("monthly_funding_amount", params[:amount])
|
||||||
|
end
|
||||||
redirect_to admin_expenses_path
|
redirect_to admin_expenses_path
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user