mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-18 20:59:39 +02:00
13 lines
382 B
Ruby
13 lines
382 B
Ruby
class SecuritiesImportJob < ApplicationJob
|
|
queue_as :default
|
|
|
|
def perform(country_code = nil)
|
|
exchanges = StockExchange.in_country(country_code)
|
|
market_stack_client = Provider::Marketstack.new(ENV["MARKETSTACK_API_KEY"])
|
|
|
|
exchanges.each do |exchange|
|
|
importer = Security::Importer.new(market_stack_client, exchange.mic)
|
|
importer.import
|
|
end
|
|
end
|
|
end
|