Skip to content

Commit

Permalink
Last try
Browse files Browse the repository at this point in the history
  • Loading branch information
isaiahzs committed Aug 31, 2018
1 parent 61b7851 commit 0101c5a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/jobs/metrics_update_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class MetricsUpdateJob < ApplicationJob

def perform(path, db_runtime)
number_of_the_day = SecureRandom.base64
return if ENV['DISABLE_QUERY_LOGGER']
# return if ENV['DISABLE_QUERY_LOGGER']
@logger ||= Logger.new(File.join(Rails.root, 'log', 'metrics_update_job_errors.log'))
puts 'Is sesnsible routes timing out?'
route = Rails.sensible_routes.match_for path
Expand All @@ -21,7 +21,7 @@ def perform(path, db_runtime)
query.average = (query.average * query.counter + db_runtime) / (query.counter += 1)
puts "#{number_of_the_day} Checkpoint 4"
# https://stackoverflow.com/questions/24270994/sudden-inexplicable-active-record-connection-timeouts-while-testing-with-rspec
ActiveRecord::Base.connection_pool.with_connection do |_conn|
Rails.application.executor.wrap do
query.save
end
puts "#{number_of_the_day} Checkpoint 5"
Expand Down

0 comments on commit 0101c5a

Please sign in to comment.