init push - laying out the project
This commit is contained in:
14
portal/app/jobs/account_sync_and_reconciliation_job.rb
Normal file
14
portal/app/jobs/account_sync_and_reconciliation_job.rb
Normal file
@ -0,0 +1,14 @@
|
||||
class AccountSyncAndReconciliationJob < ApplicationJob
|
||||
queue_as :high
|
||||
|
||||
def perform(args = {})
|
||||
ExchangeAccount.active.each do | ea|
|
||||
am = Integrations::Betfair::AccountManager.new(ea)
|
||||
bm = Integrations::Betfair::BetManager.new(ea)
|
||||
puts "Refreshing account balance on '#{ea.id}'"
|
||||
am.refresh_account_balance
|
||||
puts "Reconcile open bets on '#{ea.id}'"
|
||||
bm.check_qualified_bet_outcome(ea.my_bets.open)
|
||||
end
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user