1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-08-10 16:05:22 +02:00

Remove temporary cache-warming strategy

This commit is contained in:
Zach Gollwitzer 2025-06-17 18:18:11 -04:00
parent 940886c5fc
commit d2c8ea74cf
2 changed files with 0 additions and 14 deletions

View file

@ -13,13 +13,6 @@ class Account::Syncer
def perform_post_sync
account.family.auto_match_transfers!
# Warm IncomeStatement caches so subsequent requests are fast
# TODO: this is a temporary solution to speed up pages. Long term we'll throw a materialized view / pre-computed table
# in for family stats.
income_statement = IncomeStatement.new(account.family)
Rails.logger.info("Warming IncomeStatement caches")
income_statement.warm_caches!
end
private

View file

@ -52,13 +52,6 @@ class IncomeStatement
family_stats(interval: interval).find { |stat| stat.classification == "income" }&.median || 0
end
def warm_caches!(interval: "month")
totals
family_stats(interval: interval)
category_stats(interval: interval)
nil
end
private
ScopeTotals = Data.define(:transactions_count, :income_money, :expense_money)
PeriodTotal = Data.define(:classification, :total, :currency, :category_totals)