Class: Vendors::Klook::ProductExportWorker

Inherits:
ApplicationWorker
  • Object
show all
Defined in:
app/workers/vendors/klook/product_export_worker.rb

Overview

This worker refreshes cache for klook product index API and uploads gzip to AWS

Instance Method Summary collapse

Instance Method Details

#perform(args = {}) ⇒ Object



8
9
10
11
12
13
14
15
16
17
# File 'app/workers/vendors/klook/product_export_worker.rb', line 8

def perform(args = {})
  force = args['force'] || false
  return false unless force || IS_PRODUCTION_ENV

  VendorsService::Klook::ProductService.new.export
  true
rescue StandardError => e
  APMErrorHandler.report("#{self.class.name}: #{e.message}", error: e)
  false
end