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

Add env to toggle provider price syncs

This commit is contained in:
Zach Gollwitzer 2025-05-09 16:59:23 -04:00
parent 48a07d6158
commit 0006b6f6ca
2 changed files with 4 additions and 0 deletions

View file

@ -29,6 +29,8 @@ module Security::Provided
end
def sync_provider_prices(start_date:, end_date: Date.current)
return 0 unless ENV["PROVIDER_PRICE_SYNC_ENABLED"] == "true"
unless has_prices?
Rails.logger.warn("Security id=#{id} ticker=#{ticker} is not known by provider, skipping price sync")
return 0