2018-03-17 18:26:18 +05:30
|
|
|
module Gitlab
|
|
|
|
module QueryLimiting
|
|
|
|
class ActiveSupportSubscriber < ActiveSupport::Subscriber
|
|
|
|
attach_to :active_record
|
|
|
|
|
2018-03-27 19:54:05 +05:30
|
|
|
def sql(event)
|
|
|
|
unless event.payload[:name] == 'CACHE'
|
|
|
|
Transaction.current&.increment
|
|
|
|
end
|
2018-03-17 18:26:18 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|