Skip to content

Commit

Permalink
Add a version check for Rails whether to use pg interval or calculate…
Browse files Browse the repository at this point in the history
… float
  • Loading branch information
bensheldon committed Jul 6, 2024
1 parent 94b672c commit a04f298
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/models/good_job/discrete_execution.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ def queue_latency

# Monotonic time between when this job started and finished
def runtime_latency
if self.class.monotonic_duration_migrated?
# migrated and Rails greater than 6.1
if self.class.monotonic_duration_migrated? && Gem::Version.new(Rails.version) >= Gem::Version.new('6.1.0.a')
duration
elsif performed_at
(finished_at || Time.current) - performed_at
Expand Down

0 comments on commit a04f298

Please sign in to comment.