diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-04-21 02:50:22 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-04-21 02:50:22 +0300 |
commit | 9dc93a4519d9d5d7be48ff274127136236a3adb3 (patch) | |
tree | 70467ae3692a0e35e5ea56bcb803eb512a10bedb /spec/support/sidekiq_middleware.rb | |
parent | 4b0f34b6d759d6299322b3a54453e930c6121ff0 (diff) |
Add latest changes from gitlab-org/gitlab@13-11-stable-eev13.11.0-rc43
Diffstat (limited to 'spec/support/sidekiq_middleware.rb')
-rw-r--r-- | spec/support/sidekiq_middleware.rb | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/spec/support/sidekiq_middleware.rb b/spec/support/sidekiq_middleware.rb index 62f81ef1669..cbd6163d46b 100644 --- a/spec/support/sidekiq_middleware.rb +++ b/spec/support/sidekiq_middleware.rb @@ -15,20 +15,14 @@ end # If Sidekiq::Testing.inline! is used, SQL transactions done inside # Sidekiq worker are included in the SQL query limit (in a real -# deployment sidekiq worker is executed separately). To avoid -# increasing SQL limit counter, the request is marked as whitelisted -# during Sidekiq block +# deployment sidekiq worker is executed separately). To avoid increasing +# SQL limit counter, query limiting is disabled during Sidekiq block class DisableQueryLimit def call(worker_instance, msg, queue) - transaction = Gitlab::QueryLimiting::Transaction.current - - if !transaction.respond_to?(:whitelisted) || transaction.whitelisted - yield - else - transaction.whitelisted = true - yield - transaction.whitelisted = false - end + ::Gitlab::QueryLimiting.disable!('https://mock-issue') + yield + ensure + ::Gitlab::QueryLimiting.enable! end end |