init push - laying out the project
This commit is contained in:
13
portal/app/jobs/pull_upcoming_events_job.rb
Normal file
13
portal/app/jobs/pull_upcoming_events_job.rb
Normal file
@ -0,0 +1,13 @@
|
||||
class PullUpcomingEventsJob < 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)
|
||||
top_of_hour = Time.now.beginning_of_hour
|
||||
hunter.events_in_timeframe(from: top_of_hour, to: top_of_hour + 1.hour) #pull events
|
||||
hunter.event_markets_and_selections #refresh the markets to include
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user