mirror of
https://github.com/neocities/neocities.git
synced 2025-04-25 01:32:36 +02:00
quick and dirty, not thread safe, temporary stripe customers cache for stats
This commit is contained in:
parent
25698f1b9c
commit
6da092aee7
1 changed files with 9 additions and 1 deletions
|
@ -36,7 +36,15 @@ get '/stats/?' do
|
|||
|
||||
@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
|
||||
$stripe_cache = {
|
||||
customers: customers,
|
||||
time: Time.now
|
||||
}
|
||||
end
|
||||
|
||||
@stats[:monthly_revenue] = 0.0
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue