Method: Delayed::Backend::ActiveRecord::Job.db_time_now

Defined in:
lib/delayed/backend/active_record.rb

.db_time_nowObject

Get the current time (GMT or local depending on DB) Note: This does not ping the DB to get the time, so all your clients must have syncronized clocks.


80
81
82
83
84
85
86
87
88
# File 'lib/delayed/backend/active_record.rb', line 80

def self.db_time_now
  if Time.zone
    Time.zone.now
  elsif ::ActiveRecord::Base.default_timezone == :utc
    Time.now.utc
  else
    Time.now
  end
end