gitlab-org--gitlab-foss/lib/gitlab/query_limiting/active_support_subscriber.rb
2018-05-31 15:02:45 +02:00

13 lines
310 B
Ruby

module Gitlab
module QueryLimiting
class ActiveSupportSubscriber < ActiveSupport::Subscriber
attach_to :active_record
def sql(event)
unless event.payload.fetch(:cached, event.payload[:name] == 'CACHE')
Transaction.current&.increment
end
end
end
end
end