init push - laying out the project
This commit is contained in:
13
portal/app/jobs/pull_latest_odds_prices_job.rb
Normal file
13
portal/app/jobs/pull_latest_odds_prices_job.rb
Normal file
@ -0,0 +1,13 @@
|
||||
class PullLatestOddsPricesJob < ApplicationJob
|
||||
queue_as :medium
|
||||
|
||||
def perform(args = {})
|
||||
ea = ExchangeAccount.find_by(id: ENV['BETFAIR_HUNTER_ACCOUNT'])
|
||||
raise 'No Betfair hunter account' unless ea
|
||||
|
||||
hunter = Integrations::Betfair::OpportunityHunter.new(ea)
|
||||
BetfairEventRunner.runners_for_open_events.each do | runner |
|
||||
PullRunnerOddsJob.perform_later(hunter: hunter, runner: runner)
|
||||
end
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user