diff options
Diffstat (limited to 'lib/gitlab/query_limiting/active_support_subscriber.rb')
-rw-r--r-- | lib/gitlab/query_limiting/active_support_subscriber.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/gitlab/query_limiting/active_support_subscriber.rb b/lib/gitlab/query_limiting/active_support_subscriber.rb new file mode 100644 index 00000000000..66049c94ec6 --- /dev/null +++ b/lib/gitlab/query_limiting/active_support_subscriber.rb @@ -0,0 +1,11 @@ +module Gitlab + module QueryLimiting + class ActiveSupportSubscriber < ActiveSupport::Subscriber + attach_to :active_record + + def sql(*) + Transaction.current&.increment + end + end + end +end |