quick and dirty, not thread safe, temporary stripe customers cache for stats

This commit is contained in:
Kyle Drake 2015-03-06 16:11:34 -05:00
parent 25698f1b9c
commit 6da092aee7

View file

@ -36,7 +36,15 @@ get '/stats/?' do
@stats[:monthly_stats] = monthly_stats @stats[:monthly_stats] = monthly_stats
if $stripe_cache && Time.now < $stripe_cache[:time] + 14400
customers = $stripe_cache[:customers]
else
customers = Stripe::Customer.all limit: 100000 customers = Stripe::Customer.all limit: 100000
$stripe_cache = {
customers: customers,
time: Time.now
}
end
@stats[:monthly_revenue] = 0.0 @stats[:monthly_revenue] = 0.0