Class: Spotlight::ReindexingLogEntry

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/spotlight/reindexing_log_entry.rb

Overview

a log entry representing an attempt to reindex some number of records in an exhibit

Instance Method Summary collapse

Instance Method Details

#durationObject



15
16
17
# File 'app/models/spotlight/reindexing_log_entry.rb', line 15

def duration
  end_time - start_time if end_time
end

#failed!Object



33
34
35
36
37
38
# File 'app/models/spotlight/reindexing_log_entry.rb', line 33

def failed!
  self.end_time = Time.zone.now
  super
rescue
  Rails.logger.error "unexpected error updating log entry to :failed from #{caller}"
end

#in_progress!Object



19
20
21
22
23
24
# File 'app/models/spotlight/reindexing_log_entry.rb', line 19

def in_progress!
  self.start_time = Time.zone.now
  super
rescue
  Rails.logger.error "unexpected error updating log entry to :in_progress from #{caller}"
end

#succeeded!Object



26
27
28
29
30
31
# File 'app/models/spotlight/reindexing_log_entry.rb', line 26

def succeeded!
  self.end_time = Time.zone.now
  super
rescue
  Rails.logger.error "unexpected error updating log entry to :succeeded from #{caller}"
end