2018-01-15 10:21:04 -05:00
|
|
|
module Gitlab
|
|
|
|
module QueryLimiting
|
|
|
|
class ActiveSupportSubscriber < ActiveSupport::Subscriber
|
|
|
|
attach_to :active_record
|
|
|
|
|
2018-02-21 00:27:05 -05:00
|
|
|
def sql(event)
|
|
|
|
unless event.payload[:name] == 'CACHE'
|
|
|
|
Transaction.current&.increment
|
|
|
|
end
|
2018-01-15 10:21:04 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|