Pass a threshold to `Gitlab::QueryLimiting.disable!(issue)`
Problem
While Gitlab::QueryLimiting.disable!(issue)
is used (see https://docs.gitlab.com/ee/development/database/query_count_limits.html) the limiting is completely disabled. With that we no longer have visibility over the amount of queries per controller/service/worker.
Proposed solution
Pass a threshold to Gitlab::QueryLimiting.disable!(issue, threshold: X)
.
This aligns with the current anti-pattern allow(Gitlab::QueryLimiting::Transaction).to receive(:threshold).and_return(X)
(#468137) used in specs and allows to track the amount of queries.