mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-05 13:35:21 +02:00
Stock imports (#1363)
* Initial pass * Marketstack data provider * Marketstack data provider * Refactor a bit
This commit is contained in:
parent
b611dfdf37
commit
aa3342b0dc
10 changed files with 187 additions and 1 deletions
13
app/jobs/securities_import_job.rb
Normal file
13
app/jobs/securities_import_job.rb
Normal file
|
@ -0,0 +1,13 @@
|
|||
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
|
Loading…
Add table
Add a link
Reference in a new issue