Class: CallLogImporterWorker

Inherits:
Object
  • Object
show all
Includes:
Sidekiq::Job
Defined in:
app/workers/call_log_importer_worker.rb

Instance Method Summary collapse

Instance Method Details

#performObject



5
6
7
8
9
10
11
12
13
14
15
# File 'app/workers/call_log_importer_worker.rb', line 5

def perform
  # Import new call log but always start at the beginning_of_day
  res = Phone::CallLogImporter.new.process
  # This ongoing process will attempt to match newly discovered call records
  CallLogEvent.populate_missing_call_records(start_time: res.start_time - 1.hour)
  # Now import queue call logs
  QueueCallLog.import_new_queue_call_logs
  # Refresh KPI Call data
  hour = Time.current.hour
  ViewCallStatistic.refresh if hour >=6 && hour <= 18
end