Class: Launchpad::IEO::SalePairListWorker

Inherits:
Object
  • Object
show all
Includes:
Sidekiq::Worker
Defined in:
app/workers/launchpad/ieo/sale_pair_list_worker.rb

Instance Method Summary collapse

Instance Method Details

#perform(sgid) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
# File 'app/workers/launchpad/ieo/sale_pair_list_worker.rb', line 7

def perform(sgid)
  sale_pair = GlobalID::Locator.locate_signed(sgid, for: "sale_pair_list")
  sale_pair.list_market
  sale_pair.update!(listed: true)

  Rails.logger.info { "Successfully listed #{sale_pair.id} sale pair" }
rescue ManagementAPIV2::Exception => e
  sale_pair.update!(listed: false)
  Rails.logger.error sale_pair_id: sale_pair.id,
                    message:      "Failed to list",
                    error:        e.message
end