Class: Gera::CurrencyRatesWorker

Inherits:
Object
  • Object
show all
Includes:
AutoLogger, Sidekiq::Worker
Defined in:
app/workers/gera/currency_rates_worker.rb

Overview

Build currency rates on base of imported rates and calculation modes

Constant Summary collapse

Error =
Class.new StandardError

Instance Method Summary collapse

Instance Method Details

#performObject



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'app/workers/gera/currency_rates_worker.rb', line 13

def perform
  logger.info 'start'

  CurrencyRate.transaction do
    @snapshot = create_snapshot

    Gera::CurrencyPair.all.each do |pair|
      create_rate pair
    end
  end

  logger.info 'finish'

  DirectionsRatesWorker.perform_async

  true
end