mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-02 20:15:22 +02:00
perf(income statement): cache income statement queries (#2371)
* Leftover cleanup from prior PR * Benchmark convenience task * Change default warm benchmark time * Cache income statement queries * Fix private method access
This commit is contained in:
parent
84b2426e54
commit
a5f1677f60
6 changed files with 103 additions and 77 deletions
|
@ -13,6 +13,13 @@ 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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue