mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-02 20:15:22 +02:00
Handle missing weekend stock prices in sync process (#1242)
* Don't append missing prices if already known * Add failing test * Handle weekend stock prices * Fix tests and gapfill logic
This commit is contained in:
parent
e8d7ee3270
commit
24d3c0243f
5 changed files with 80 additions and 7 deletions
|
@ -48,7 +48,9 @@ class Account::Holding::Syncer
|
|||
end
|
||||
|
||||
ticker_start_dates.each do |ticker, date|
|
||||
prices[ticker] = Security::Price.find_prices(ticker: ticker, start_date: date, end_date: Date.current)
|
||||
fetched_prices = Security::Price.find_prices(ticker: ticker, start_date: date, end_date: Date.current)
|
||||
gapfilled_prices = Gapfiller.new(fetched_prices, start_date: date, end_date: Date.current, cache: false).run
|
||||
prices[ticker] = gapfilled_prices
|
||||
end
|
||||
|
||||
prices
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue