init push - laying out the project
This commit is contained in:
16
portal/app/jobs/pull_tips_job.rb
Normal file
16
portal/app/jobs/pull_tips_job.rb
Normal file
@ -0,0 +1,16 @@
|
||||
class PullTipsJob < ApplicationJob
|
||||
queue_as :high
|
||||
|
||||
def perform(args = {})
|
||||
ta = TipsterAccount.find_by(id: ENV['TIPSTER_ACCOUNT'])
|
||||
bb = Integrations::Betburger.new(ta)
|
||||
ta.tip_sources.active_sources.each do |ts|
|
||||
tsd = bb.pull_and_save_tips(ts)
|
||||
ts.source_subscriptions.each do |ss|
|
||||
next unless ss.exchange_account.active?
|
||||
|
||||
ProcessSubscriptionJob.perform_later(subscription: ss, tsd: tsd)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user