debian-mirror-gitlab/lib/gitlab/query_limiting/active_support_subscriber.rb
2019-02-13 22:33:31 +05:30

15 lines
341 B
Ruby

# frozen_string_literal: true
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