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



17
18
19
# File 'app/models/spotlight/reindexing_log_entry.rb', line 17

def duration
  end_time - start_time if end_time
end

#failed!Object



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

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



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

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



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

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