mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-10 07:55:21 +02:00
Clean up market data methods
This commit is contained in:
parent
efea7bfc01
commit
267692d297
2 changed files with 6 additions and 3 deletions
|
@ -2,8 +2,6 @@ class SyncMarketDataJob < ApplicationJob
|
|||
queue_as :scheduled
|
||||
|
||||
def perform(*args)
|
||||
syncer = MarketDataSyncer.new
|
||||
syncer.sync_exchange_rates
|
||||
syncer.sync_prices
|
||||
MarketDataSyncer.new.sync_all
|
||||
end
|
||||
end
|
||||
|
|
|
@ -20,6 +20,11 @@ class MarketDataSyncer
|
|||
@account = account
|
||||
end
|
||||
|
||||
def sync_all(full_history: false)
|
||||
sync_exchange_rates(full_history: full_history)
|
||||
sync_prices(full_history: full_history)
|
||||
end
|
||||
|
||||
def sync_exchange_rates(full_history: false)
|
||||
unless rate_provider
|
||||
Rails.logger.warn("No rate provider configured for MarketDataSyncer.sync_exchange_rates, skipping sync")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue